Skip to content

Commit

Permalink
replace string.Join+empty with sting.concat (#1398)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Feb 17, 2024
1 parent cb832cf commit 1246853
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public override string Convert(long input)
}
}

return string.Join("", parts);
return string.Concat(parts);
}

public override string ConvertToOrdinal(int number) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public override string Convert(long input)
parts.Add(UnitsMap[number]);
}

return string.Join("", parts).Trim();
return string.Concat( parts).Trim();
}

static string GetOrdinalUnit(int number, bool useExceptions)
Expand Down Expand Up @@ -143,7 +143,7 @@ static string ToOrdinal(int number, bool useExceptions)
parts.Add(GetOrdinalUnit(number, useExceptions));
}

return string.Join("", parts);
return string.Concat(parts);
}

public override string ConvertToOrdinal(int number) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public override string Convert(long number, GrammaticalGender gender, bool addAn
}
}

return string.Join("", parts);
return string.Concat(parts);
}

public override string ConvertToOrdinal(int number, GrammaticalGender gender)
Expand Down Expand Up @@ -95,7 +95,7 @@ public override string ConvertToOrdinal(int number, GrammaticalGender gender)

parts.Add(GetEndingForGender(gender));

return string.Join("", parts);
return string.Concat(parts);
}

void CollectParts(ICollection<string> parts, ref long number, long divisor, bool addSpaceBeforeNextPart, string pluralFormat, string singular)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public override string Convert(long number, WordForm wordForm, GrammaticalGender

if (number <= 0)
{
return string.Join("", parts);
return string.Concat(parts);
}

if (number < 20)
Expand Down Expand Up @@ -78,7 +78,7 @@ public override string Convert(long number, WordForm wordForm, GrammaticalGender
parts.Add(tens);
}

return string.Join("", parts);
return string.Concat(parts);
}

public override string ConvertToOrdinal(int number, GrammaticalGender gender)
Expand Down Expand Up @@ -112,7 +112,7 @@ public override string ConvertToOrdinal(int number, GrammaticalGender gender)

parts.Add(GetEndingForGender(gender));

return string.Join("", parts);
return string.Concat(parts);
}

private void CollectParts(ICollection<string> parts, ref long number, long divisor, bool addSpaceBeforeNextPart, string pluralFormat, string singular)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ static string GetPrefix(long number)
parts.Add(number == 1 ? "одно" : UnitsOrdinalPrefixes[number]);
}

return string.Join("", parts);
return string.Concat(parts);
}

static void CollectParts(ICollection<string> parts, ref long number, long divisor, GrammaticalGender gender, params string[] forms)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public override string Convert(long input)
}
}

return string.Join("", parts);
return string.Concat(parts);
}

public override string ConvertToOrdinal(int number) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public override string Convert(long input)
}
}

return string.Join("", parts);
return string.Concat(parts);
}

public override string ConvertToOrdinal(int number) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public override string Convert(long input)
}
}

return string.Join("", parts);
return string.Concat(parts);
}

public override string ConvertToOrdinal(int number) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static string GetPrefix(int number)
parts.Add(number == 1 ? "одно" : UnitsOrdinalPrefixes[number]);
}

return string.Join("", parts);
return string.Concat(parts);
}

static void CollectParts(ICollection<string> parts, ref long number, long divisor, GrammaticalGender gender, params string[] forms)
Expand Down
2 changes: 1 addition & 1 deletion src/Humanizer/StringDehumanizeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class StringDehumanizeExtensions
public static string Dehumanize(this string input)
{
var pascalizedWords = input.Split(' ').Select(word => word.Humanize().Pascalize());
return string.Join("", pascalizedWords).Replace(" ", "");
return string.Concat(pascalizedWords).Replace(" ", "");
}
}
}

0 comments on commit 1246853

Please sign in to comment.