-
-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reuse LD_STRING_OR_BUFFER_TO_COPY() macro in ToSlice() function
The ToSlice() function corresponds to the old LD_STRING_OR_BUFFER_TO_SLICE() macro with the exception that we _always_ copy the buffer/string. I've chosen this approach for the following reasons: * We use the _same_ code for copying buffers/strings for iterators (e.g. for lt, lte, gt, gte etc) * The code for handling cleanup of leveldb::Slice() should always cleanup the underlying buffer (since we always copy) * For simplicity. At the moment of rewriting to napi it's a lot to keep in the head to move forward. Later on we should benchmark this and tweak/optimize if needed. Maybe it has a huge impact on performance, but until we know this for sure, I think we can simplify with good conscience. The difference between old LD_STRING_OR_BUFFER_TO_COPY
- Loading branch information
1 parent
6889722
commit 182a58b
Showing
1 changed file
with
22 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters