diff options
| author | Johannes Altmanninger <aclopte@gmail.com> | 2025-05-10 21:13:09 +0200 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2025-05-11 09:57:01 +1000 |
| commit | 7c3efe3b92816697383c5792d7876e7ed6e331ae (patch) | |
| tree | 019a020da99685b0ff9c40d06c2dfa7c47501a4b /src/string.hh | |
| parent | dedbc2179cdb8f287b042462de040d125ae796b2 (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/string.hh')
| -rw-r--r-- | src/string.hh | 2 |
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; } |
