fix(core): Updates slice with range selectors (#583)
- [X] Replaces Span slicing with range selection - [X] Replaces string slicing with range selection
This commit is contained in:
parent
9f9d990f85
commit
a0893b68c0
62 changed files with 363 additions and 382 deletions
|
|
@ -353,7 +353,7 @@ namespace Server.Guilds
|
|||
|
||||
if (length != buffer.Length)
|
||||
{
|
||||
buffer = buffer.SliceToLength(length); // Adjust to the actual size
|
||||
buffer = buffer[..length]; // Adjust to the actual size
|
||||
}
|
||||
|
||||
g.Members[j].NetState?.Send(buffer);
|
||||
|
|
@ -1530,7 +1530,7 @@ namespace Server.Guilds
|
|||
|
||||
if (length != buffer.Length)
|
||||
{
|
||||
buffer = buffer.SliceToLength(length); // Adjust to the actual size
|
||||
buffer = buffer[..length]; // Adjust to the actual size
|
||||
}
|
||||
|
||||
Members[i].NetState?.Send(buffer);
|
||||
|
|
|
|||
|
|
@ -1092,7 +1092,7 @@ namespace Server
|
|||
return;
|
||||
}
|
||||
|
||||
Count = Utility.ToInt32(str.Substring(start, index - start));
|
||||
Count = Utility.ToInt32(str.Substring(start, index));
|
||||
|
||||
start = index + 1;
|
||||
index = str.IndexOf('+', start);
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ namespace Server.Misc
|
|||
|
||||
if (mob.Female && skillTitle.EndsWithOrdinal("man"))
|
||||
{
|
||||
skillTitle = $"{skillTitle.Substring(0, skillTitle.Length - 3)}woman";
|
||||
skillTitle = $"{skillTitle[..^3]}woman";
|
||||
}
|
||||
|
||||
return $"{skillLevel} {skillTitle}";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue