File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -2308,7 +2308,7 @@ using ErrorValues [[deprecated("This is an alias and will be removed, use error_
2308
2308
* @deprecated Error codes should be stored and returned as `error_code`, use `error_message()` instead.
2309
2309
*/
2310
2310
[[deprecated(" Error codes should be stored and returned as `error_code`, use `error_message()` instead." )]]
2311
- inline const std::string & error_message(int error) noexcept;
2311
+ inline const std::string error_message(int error) noexcept;
2312
2312
2313
2313
} // namespace simdjson
2314
2314
@@ -6367,7 +6367,7 @@ namespace internal {
6367
6367
// We store the error code so we can validate the error message is associated with the right code
6368
6368
struct error_code_info {
6369
6369
error_code code;
6370
- std::string message;
6370
+ const char * message;
6371
6371
};
6372
6372
// These MUST match the codes in error_code. We check this constraint in basictests.
6373
6373
extern SIMDJSON_DLLIMPORTEXPORT const error_code_info error_codes[];
@@ -6376,10 +6376,10 @@ namespace internal {
6376
6376
6377
6377
inline const char *error_message (error_code error) noexcept {
6378
6378
// If you're using error_code, we're trusting you got it from the enum.
6379
- return internal::error_codes[int (error)].message . c_str () ;
6379
+ return internal::error_codes[int (error)].message ;
6380
6380
}
6381
6381
6382
- inline const std::string & error_message (int error) noexcept {
6382
+ inline const std::string error_message (int error) noexcept {
6383
6383
if (error < 0 || error >= error_code::NUM_ERROR_CODES) {
6384
6384
return internal::error_codes[UNEXPECTED_ERROR].message ;
6385
6385
}
You can’t perform that action at this time.
0 commit comments