[Refactor] Call string.Equals instead of string.Compare.

This commit is contained in:
2025-11-24 20:27:29 +00:00
parent 13a200d10b
commit 599454377e
20 changed files with 135 additions and 154 deletions

View File

@@ -51,11 +51,12 @@ public sealed partial class CPM
if(!_fileCache.ContainsKey(pathElements[0].ToUpperInvariant())) return ErrorNumber.NoSuchFile;
if(string.Compare(xattr, "com.caldera.cpm.password", StringComparison.InvariantCulture) == 0)
if(!_passwordCache.TryGetValue(pathElements[0].ToUpperInvariant(), out buf))
return ErrorNumber.NoError;
if(string.Equals(xattr, "com.caldera.cpm.password", StringComparison.InvariantCulture))
{
if(!_passwordCache.TryGetValue(pathElements[0].ToUpperInvariant(), out buf)) return ErrorNumber.NoError;
}
if(string.Compare(xattr, "com.caldera.cpm.password.text", StringComparison.InvariantCulture) != 0)
if(!string.Equals(xattr, "com.caldera.cpm.password.text", StringComparison.InvariantCulture))
return ErrorNumber.NoSuchExtendedAttribute;
return !_passwordCache.TryGetValue(pathElements[0].ToUpperInvariant(), out buf)