Use 'var' for local variables in AcWebSignalRHubBase

Replaced explicit 'int' declarations with 'var' for local variables in for loops and variable initializations. This improves code conciseness and maintains consistency without altering functionality.
This commit is contained in:
Loretta 2025-12-23 11:11:51 +01:00
parent d35c7bd066
commit a2f392a247
1 changed files with 4 additions and 4 deletions

View File

@ -114,8 +114,8 @@ public abstract class AcWebSignalRHubBase<TSignalRTags, TLogger>(IConfiguration
private static (uint value, int bytesRead) ReadVarUIntFromBytes(byte[] data, int startPos) private static (uint value, int bytesRead) ReadVarUIntFromBytes(byte[] data, int startPos)
{ {
uint value = 0; uint value = 0;
int shift = 0; var shift = 0;
int bytesRead = 0; var bytesRead = 0;
while (startPos + bytesRead < data.Length) while (startPos + bytesRead < data.Length)
{ {
@ -205,7 +205,7 @@ public abstract class AcWebSignalRHubBase<TSignalRTags, TLogger>(IConfiguration
// Log in declaration order (not alphabetically) // Log in declaration order (not alphabetically)
Logger.Info($"{prefix} Property Count: {props.Length}"); Logger.Info($"{prefix} Property Count: {props.Length}");
for (int i = 0; i < props.Length; i++) for (var i = 0; i < props.Length; i++)
{ {
var p = props[i]; var p = props[i];
var declaringType = p.DeclaringType?.Name ?? "?"; var declaringType = p.DeclaringType?.Name ?? "?";
@ -240,7 +240,7 @@ public abstract class AcWebSignalRHubBase<TSignalRTags, TLogger>(IConfiguration
Logger.Info($"Header property count: {propCount}"); Logger.Info($"Header property count: {propCount}");
for (int i = 0; i < (int)propCount && pos < responseData.Length; i++) for (var i = 0; i < (int)propCount && pos < responseData.Length; i++)
{ {
// Read string length as VarUInt // Read string length as VarUInt
var (strLen, strLenBytes) = ReadVarUIntFromBytes(responseData, pos); var (strLen, strLenBytes) = ReadVarUIntFromBytes(responseData, pos);