-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is performance inefficiency found by coverity tool json2.1.1/include/nlohmann/json.hpp #673
Comments
Thanks for reporting. Here is the line in context: https://github.com/nlohmann/json/blob/v2.1.1/src/json.hpp#L4066 |
This is also relevant for 3.0.0. |
Fixed. Thanks for reporting! |
Wouldn't using universal reference instead of This
reference example https://godbolt.org/g/Yq2euX |
There is quite a lot of room for zero-copy/rvalue references support in the library indeed. Note that the return type should be changed to |
@murderotica, @theodelrieu Can you create a PR for these optimizations? |
I'll add that to my TODO list. |
Thanks! |
4063 @SInCE version 1.0.0
4064 */
4065 template<class ValueType, typename std::enable_if<
4066 std::is_convertible<basic_json_t, ValueType>::value, int>::type = 0>
CID 10413 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
pass_by_value: Passing parameter default_value of type cerebras::file_metadata (size 168 bytes) by value.
4067 ValueType value(const typename object_t::key_type& key, ValueType default_value) const
4068 {
The text was updated successfully, but these errors were encountered: