projects
/
platform
/
upstream
/
coreclr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e90d6ef
)
String.SplitInternal: Remove unnecessary stackalloc (#7623)
author
Justin Van Patten
<jvp@justinvp.com>
Sat, 15 Oct 2016 09:58:59 +0000
(
02:58
-0700)
committer
Jan Kotas
<jkotas@microsoft.com>
Sat, 15 Oct 2016 09:58:59 +0000
(
02:58
-0700)
Simply take the address of the `char` instead of stackallocating a
`char[1]`.
src/mscorlib/src/System/String.Manipulation.cs
patch
|
blob
|
history
diff --git
a/src/mscorlib/src/System/String.Manipulation.cs
b/src/mscorlib/src/System/String.Manipulation.cs
index d21c06899bb304c5f9f19c6108cfb98c39b5e405..8c81897d722f62ce111accf707a28a5293c9dadd 100644
(file)
--- a/
src/mscorlib/src/System/String.Manipulation.cs
+++ b/
src/mscorlib/src/System/String.Manipulation.cs
@@
-1001,9
+1001,7
@@
namespace System
[System.Security.SecuritySafeCritical]
private unsafe String[] SplitInternal(char separator, int count, StringSplitOptions options)
{
- char* pSeparators = stackalloc char[1];
- pSeparators[0] = separator;
- return SplitInternal(pSeparators, /*separatorsLength*/ 1, count, options);
+ return SplitInternal(&separator, 1, count, options);
}
[System.Security.SecuritySafeCritical]