diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-08-22 13:12:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-22 13:12:58 +0200 |
commit | 7ebb25cca193063f0a3ff2ec8b6206e0832e1215 (patch) | |
tree | fbcfa265403eeaac463038c2b08cd2475f267b30 /src/nvim/buffer.c | |
parent | 3d3c0c669d054ef49304223e3b91ac820996d1e0 (diff) | |
parent | c265fd31ab2b0307650ad94e1ea272e9360c345f (diff) | |
download | rneovim-7ebb25cca193063f0a3ff2ec8b6206e0832e1215.tar.gz rneovim-7ebb25cca193063f0a3ff2ec8b6206e0832e1215.tar.bz2 rneovim-7ebb25cca193063f0a3ff2ec8b6206e0832e1215.zip |
Merge pull request #15451 from bfredl/metamap
perf(map): get rid of unnecessary pointer indirections for maps.
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index a7fc34f2d6..fdb3ffdc7e 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -24,7 +24,6 @@ #include <inttypes.h> #include <assert.h> -#include "nvim/api/private/handle.h" #include "nvim/api/private/helpers.h" #include "nvim/api/vim.h" #include "nvim/ascii.h" @@ -757,7 +756,7 @@ void buf_freeall(buf_T *buf, int flags) */ static void free_buffer(buf_T *buf) { - handle_unregister_buffer(buf); + pmap_del(handle_T)(&buffer_handles, buf->b_fnum); buf_free_count++; // b:changedtick uses an item in buf_T. free_buffer_stuff(buf, kBffClearWinInfo); @@ -1841,7 +1840,7 @@ buf_T *buflist_new(char_u *ffname_arg, char_u *sfname_arg, linenr_T lnum, lastbuf = buf; buf->b_fnum = top_file_num++; - handle_register_buffer(buf); + pmap_put(handle_T)(&buffer_handles, buf->b_fnum, buf); if (top_file_num < 0) { // wrap around (may cause duplicates) EMSG(_("W14: Warning: List of file names overflow")); if (emsg_silent == 0) { |