Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_string_ref.hh4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_string_ref.hh b/source/blender/blenlib/BLI_string_ref.hh
index 34baf94c448..dc73208350f 100644
--- a/source/blender/blenlib/BLI_string_ref.hh
+++ b/source/blender/blenlib/BLI_string_ref.hh
@@ -610,6 +610,10 @@ constexpr bool operator==(StringRef a, StringRef b)
if (a.size() != b.size()) {
return false;
}
+ if (a.data() == b.data()) {
+ /* This also avoids passing null to the call below, which would results in an ASAN warning. */
+ return true;
+ }
return STREQLEN(a.data(), b.data(), (size_t)a.size());
}