Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetProcessShortName()

static string System.Diagnostics.NtProcessInfoHelper.GetProcessShortName ( ReadOnlySpan< char > name)
inlinestaticpackage

Definition at line 134 of file NtProcessInfoHelper.cs.

135 {
136 if (name.IsEmpty)
137 {
138 return string.Empty;
139 }
140 int num = -1;
141 int num2 = -1;
142 for (int i = 0; i < name.Length; i++)
143 {
144 if (name[i] == '\\')
145 {
146 num = i;
147 }
148 else if (name[i] == '.')
149 {
150 num2 = i;
151 }
152 }
153 if (num2 == -1)
154 {
155 num2 = name.Length - 1;
156 }
157 else
158 {
160 num2 = ((!MemoryExtensions.Equals(span, ".exe", StringComparison.OrdinalIgnoreCase)) ? (name.Length - 1) : (num2 - 1));
161 }
162 num = ((num != -1) ? (num + 1) : 0);
163 return name.Slice(num, num2 - num + 1).ToString();
164 }

References System.MemoryExtensions.Equals().

Referenced by System.Diagnostics.NtProcessInfoHelper.GetProcessInfos().