From d24415502131a8c863ede4fcbe31a7b87912dcc1 Mon Sep 17 00:00:00 2001
From: Thorsten Hater <24411438+thorstenhater@users.noreply.github.com>
Date: Wed, 14 Dec 2022 17:22:19 +0100
Subject: [PATCH] Allow __ in profiler names. (#2065)

Allow `__` in profiler names, now that we split on `:`.
---
 arbor/profile/profiler.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arbor/profile/profiler.cpp b/arbor/profile/profiler.cpp
index be5b2aff..0a6af0a2 100644
--- a/arbor/profile/profiler.cpp
+++ b/arbor/profile/profiler.cpp
@@ -20,8 +20,7 @@ using util::make_span;
 namespace {
     // Check whether a string describes a valid profiler region name.
     bool is_valid_region_string(const std::string& s) {
-        if (s.size()==0u || s.front()==':' || s.back()==':') return false;
-        return s.find("__") == s.npos;
+        return (s.size()!=0u) && (s.front()!=':') && (s.back()!=':');
     }
 
     //
-- 
GitLab