summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2025-05-10 21:13:09 +0200
committerMaxime Coste <mawww@kakoune.org>2025-05-11 09:57:01 +1000
commit7c3efe3b92816697383c5792d7876e7ed6e331ae (patch)
tree019a020da99685b0ff9c40d06c2dfa7c47501a4b /src
parentdedbc2179cdb8f287b042462de040d125ae796b2 (diff)
Update GDB pretty printer following SSO layout change
Commit 2754e27cf (Increase SSO from 22 to 23 chars., 2024-06-07) changed they layout of SSO-strings. Specifically, is_long() no longer takes a bit away from the size field. Update the GDB pretty printer accordingly, making it work with small strings again.
Diffstat (limited to 'src')
-rw-r--r--src/string.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.hh b/src/string.hh
index 677f01f5..fd1e5b74 100644
--- a/src/string.hh
+++ b/src/string.hh
@@ -184,7 +184,7 @@ public:
Data& operator=(const Data& other);
Data& operator=(Data&& other) noexcept;
- bool is_long() const { return (u.l.mode& Long::active_mask) > 0; }
+ bool is_long() const { return (u.l.mode & Long::active_mask) != 0; }
size_t size() const { return is_long() ? u.l.size : (Short::capacity - u.s.remaining_size); }
size_t capacity() const { return is_long() ? u.l.capacity : Short::capacity; }