Replace int_id<json_flag> with string_id<json_flag> (housekeeping) #45277
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Infrastructure "Replace int_id<json_flag> with string_id<json_flag> (housekeeping)"
Purpose of change
In #44694 I switched item flags from
std::string
toint_id<json_flag>
, specifically to speeduphas_flag
lookups.In a couple of places that resulted in ugly code, when a temporary collection of
string_id
s was necessary, because it was populated beforeint_ids
are available.After #45099
string_id
is faster* thanint_id
for lookups in the small collections (see "string_and_int_ids_benchmark").So currently there is no need to have the ugly code with temporary collections and all item flags can be represented as
string_id<json_flag>
.Describe the solution
flag_id
toflag_str_id
:The intension is to have a follow up PR with mass renaming of
flag_str_id
toflag_id
.Describe alternatives you've considered
None.
Testing
Game compiles and loads.
Smoke checked following things:
Also did a profiling in the item-intensive area to ensure that no performance regressions arised.
Additional context
Profiling results (after the change), filtered by

string_id<json_flag>
: