FIX: Implement caching for InputControlPath display name#2344
FIX: Implement caching for InputControlPath display name#2344josepmariapujol-unity wants to merge 2 commits intodevelopfrom
Conversation
PR Reviewer Guide 🔍(Review updated until commit 8086d03)Here are some key observations to aid the review process:
🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr |
PR Code Suggestions ✨Latest suggestions up to 8086d03
🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr Previous suggestionsSuggestions up to commit 1b38eb1
|
|||||||||||||||
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## develop #2344 +/- ##
========================================
Coverage 77.95% 77.96%
========================================
Files 476 476
Lines 97453 97522 +69
========================================
+ Hits 75971 76031 +60
- Misses 21482 21491 +9 Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Persistent review updated to latest commit 8086d03 |
| ////TODO: this should be cached; generates needless GC churn | ||
| var displayName = InputControlPath.ToHumanReadableString(path); | ||
| // Cache the display name per path value and only recompute when the string actually changes. | ||
| if (!string.Equals(path, m_CachedPath, StringComparison.Ordinal)) |
There was a problem hiding this comment.
While technically correct, I wonder if we should use InvariantCulture to match what other string comparisons in our package do. I remember there were incoming issues with Turkish about a year ago and we moved to InvariantCulture...
There was a problem hiding this comment.
Moved = we didn't specify culture rules at all, so strings would be compared differently based on the current locale
Description
Purpose of this PR is to fix the TODO by caching per path value and only recompute when the string actually
changes.
ISX-2501
Testing status & QA
Check that it works as before, when inputing in the InputControlPath.
Overall Product Risks
Please rate the potential complexity and halo effect from low to high for the reviewers. Note down potential risks to specific Editor branches if any.
Comments to reviewers
Please describe any additional information such as what to focus on, or historical info for the reviewers.
Checklist
Before review:
Changed,Fixed,Addedsections.Area_CanDoX,Area_CanDoX_EvenIfYIsTheCase,Area_WhenIDoX_AndYHappens_ThisIsTheResult.During merge:
NEW: ___.FIX: ___.DOCS: ___.CHANGE: ___.RELEASE: 1.1.0-preview.3.