diff options
author | Ran Benita <ran@unusedvar.com> | 2019-11-02 13:31:44 +0200 |
---|---|---|
committer | Ran Benita <ran@unusedvar.com> | 2019-11-08 12:13:31 +0200 |
commit | 2af474e8d07eaa92a93953024685c66d1dbc15f5 (patch) | |
tree | c2e0de98cb0df1ed66d61d6db04743ff62292bfb /src/context-priv.c | |
parent | 31e561fca9f2d6c9a0d0cc771d2bf77e6131ecdf (diff) | |
download | libxkbcommon-2af474e8d07eaa92a93953024685c66d1dbc15f5.tar.gz libxkbcommon-2af474e8d07eaa92a93953024685c66d1dbc15f5.tar.bz2 libxkbcommon-2af474e8d07eaa92a93953024685c66d1dbc15f5.zip |
parser: get rid of "stealing" atoms
This requires (well, at least implemented by) casting away `const` which
is undefined behavior, and clang started to warn about it.
The micro optimization didn't save too many allocations, anyway.
Signed-off-by: Ran Benita <ran@unusedvar.com>
Diffstat (limited to 'src/context-priv.c')
-rw-r--r-- | src/context-priv.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/context-priv.c b/src/context-priv.c index c934201..e3ba32d 100644 --- a/src/context-priv.c +++ b/src/context-priv.c @@ -58,13 +58,7 @@ xkb_atom_lookup(struct xkb_context *ctx, const char *string) xkb_atom_t xkb_atom_intern(struct xkb_context *ctx, const char *string, size_t len) { - return atom_intern(ctx->atom_table, string, len, false); -} - -xkb_atom_t -xkb_atom_steal(struct xkb_context *ctx, char *string) -{ - return atom_intern(ctx->atom_table, string, strlen(string), true); + return atom_intern(ctx->atom_table, string, len); } const char * |