Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Do not sort arrays of immutable elements, use a cast instead to preve…
Browse files Browse the repository at this point in the history
…nt a performance penalty.
  • Loading branch information
yebblies committed Jul 12, 2011
1 parent eb8246c commit 850eaa6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rt/adi.d
Expand Up @@ -315,7 +315,7 @@ extern (C) char[] _adSortChar(char[] a)
{
if (a.length > 1)
{
dstring da = toUTF32(a);
dchar[] da = cast()toUTF32(a);
da.sort;
size_t i = 0;
foreach (dchar d; da)
Expand All @@ -337,7 +337,7 @@ extern (C) wchar[] _adSortWchar(wchar[] a)
{
if (a.length > 1)
{
dstring da = toUTF32(a);
dchar[] da = cast()toUTF32(a);
da.sort;
size_t i = 0;
foreach (dchar d; da)
Expand Down

0 comments on commit 850eaa6

Please sign in to comment.