-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
Optimize TileSetAtlasSource::_get_property_list
#98317
base: master
Are you sure you want to change the base?
Conversation
scene/resources/2d/tile_set.cpp
Outdated
tile_property_list.push_back(alternative_property_info); | ||
} | ||
} | ||
|
||
// Add all alternative. | ||
const String property_info_prefix = vformat("%d:%d", E_tile.key.x, E_tile.key.y) + '/'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const String property_info_prefix = vformat("%d:%d", E_tile.key.x, E_tile.key.y) + '/'; | |
const String property_info_prefix = vformat("%d/%d/", E_tile.key.x, E_tile.key.y); |
- Copy-paste error.
- Plus
char
is unnecessary since we're already doingvformat()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Copy-paste error.
I think it should be %d:%d/%s
with the original code, have I missed something with vformat
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I looked at the wrong vformat()
call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, it's not a copy-paste error, using :
is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, just pull to local and squash these commits, will fix it.
Co-authored-by: Haoyu Qiu <[email protected]>
Fixes #98213.
TileSetAtlasSource::_get_property_list
used to callvformat
a lot with exact same args. Replace pure string formats with string concat and move others to outer loop.use a slightly modified MRP to make the difference more clear.
testgame.zip
Test Result:
Master:
master.mp4
This PR:
pr.mp4