Updated formatted GetResourceString code reduction#7136
Conversation
|
@jamesqo not sure if updating your PR breaks OSS protocol? |
|
Good idea |
|
Hah, no, it's fine. I've closed my PR. I wasn't working on it since I'm planning to introduce a new attribute specifically to denote methods that use |
|
Can't do that, branch has been deleted 😢 |
|
Ah ok 😄 /cc @jkotas |
|
|
||
| // NoInlining causes the caller and callee to not be inlined in mscorlib as it is an assumption of StackCrawlMark use | ||
| [MethodImpl(MethodImplOptions.NoInlining)] | ||
| private static String GetResourceString(string key, params object[] values) |
There was a problem hiding this comment.
This should be kept internal, otherwise things like
Environment.GetResourceString("Foo", new object[] { ... });will break since they now call the (string, object) overload.
There was a problem hiding this comment.
Ah, ok, then have to move the no-inlining about
|
Re-analysing with code adjustment |
| // NoInlining causes the caller and callee to not be inlined in mscorlib as it is an assumption of StackCrawlMark use | ||
| [MethodImpl(MethodImplOptions.NoInlining)] | ||
| private static String GetResourceString(string key, params object[] values) | ||
| private static String GetResourceString(object[] values, string key) |
There was a problem hiding this comment.
Instead of shifting around all of the parameters which will make this confusing for readers + generates a larger git diff, you could just call this GetResourceStringCore or GetResourceStringInternal?
There was a problem hiding this comment.
Shouldn't change the git diff? Anyway less confusion makes sense, made the change
|
Still good |
| return GetResourceStringFormatted(key, new object[] { val0, val1, val2, val3, val4, val5 }); | ||
| } | ||
|
|
||
| internal static String GetResourceStrings(string key, params object[] values) |
There was a problem hiding this comment.
sigh... was so it didn't get caught in my renaming,
|
Need to add |
It should not be needed. |
|
@dotnet-bot test Linux ARM Emulator Cross Debug Build |
|
Thank you! |
Update to: "Reduce code bloat around formatted GetResourceString calls" #7007
Addresses the issues raised in #7007 (comment)
Jit-Diff
/cc @jamesqo