diff options
author | Ian Boros <ian.boros@mongodb.com> | 2020-04-01 22:02:17 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-06 17:42:49 +0000 |
commit | 1fa4585c079fe392650258f0654df64d29678af4 (patch) | |
tree | 04027a80e88dbae15e6ff6261243f6ca988ba4f4 /src/mongo/scripting | |
parent | a25168b6eae5af975581028175572997839b57e4 (diff) | |
download | mongo-1fa4585c079fe392650258f0654df64d29678af4.tar.gz |
SERVER-46916 misc. map reduce performance improvements
Diffstat (limited to 'src/mongo/scripting')
-rw-r--r-- | src/mongo/scripting/mozjs/jsstringwrapper.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/scripting/mozjs/jsstringwrapper.cpp b/src/mongo/scripting/mozjs/jsstringwrapper.cpp index f488bc0a4cb..bbeefc0c8a0 100644 --- a/src/mongo/scripting/mozjs/jsstringwrapper.cpp +++ b/src/mongo/scripting/mozjs/jsstringwrapper.cpp @@ -43,7 +43,9 @@ namespace mongo { namespace mozjs { JSStringWrapper::JSStringWrapper(std::int32_t value) : _isSet(true) { - _length = sprintf(_buf, "%d", value); + auto formatted = fmt::format_int(value); + strcpy(_buf, formatted.c_str()); + _length = formatted.size(); } JSStringWrapper::JSStringWrapper(JSContext* cx, JSString* str) : _isSet(true) { |