Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Bala Perumalswamy committed Sep 5, 2023
1 parent 5144b4e commit b5b9159
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Microsoft.Azure.Cosmos/src/Query/Core/SqlQueryResumeValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,29 +68,29 @@ public static PrimitiveResumeValue Create(CosmosElement value)

private class ComplexResumeValue : SqlQueryResumeValue
{
public bool bArray { get; }
public bool IsArray { get; }

public UInt128 HashValue { get; }

private ComplexResumeValue(bool bArray, UInt128 hashValue)
private ComplexResumeValue(bool isArray, UInt128 hashValue)
{
this.bArray = bArray;
this.IsArray = isArray;
this.HashValue = hashValue;
}

public static ComplexResumeValue Create(bool bArray, UInt128 hashValue)
public static ComplexResumeValue Create(bool isArray, UInt128 hashValue)
{
return new ComplexResumeValue(bArray, hashValue);
return new ComplexResumeValue(isArray, hashValue);
}

public static ComplexResumeValue Create(CosmosArray arrayValue)
{
return Create(bArray: true, DistinctHash.GetHash(arrayValue));
return Create(isArray: true, DistinctHash.GetHash(arrayValue));
}

public static ComplexResumeValue Create(CosmosObject objectValue)
{
return Create(bArray: false, DistinctHash.GetHash(objectValue));
return Create(isArray: false, DistinctHash.GetHash(objectValue));
}
}

Expand All @@ -109,7 +109,7 @@ public int CompareTo(CosmosElement cosmosElement)

case ComplexResumeValue complexResumeValue:
{
if (complexResumeValue.bArray)
if (complexResumeValue.IsArray)
{
// If the order by result is also of array type, then compare the hash values
// For other types create an empty array and call CosmosElement comparer which
Expand Down Expand Up @@ -156,7 +156,7 @@ public static CosmosElement ToCosmosElement(SqlQueryResumeValue resumeValue)
ComplexResumeValue complexResumeValue => CosmosObject.Create(
new Dictionary<string, CosmosElement>()
{
{ PropertyNames.Type, CosmosString.Create(complexResumeValue.bArray ? PropertyNames.ArrayType : PropertyNames.ObjectType) },
{ PropertyNames.Type, CosmosString.Create(complexResumeValue.IsArray ? PropertyNames.ArrayType : PropertyNames.ObjectType) },
{ PropertyNames.Low, CosmosNumber64.Create((long)complexResumeValue.HashValue.GetLow()) },
{ PropertyNames.High, CosmosNumber64.Create((long)complexResumeValue.HashValue.GetHigh()) }
}),
Expand Down Expand Up @@ -194,7 +194,7 @@ public static void Serialize(JsonWriter writer, SqlQueryResumeValue value, JsonS
{
writer.WriteStartObject();
writer.WritePropertyName(PropertyNames.Type);
writer.WriteValue(complexResumeValue.bArray ? PropertyNames.ArrayType : PropertyNames.ObjectType);
writer.WriteValue(complexResumeValue.IsArray ? PropertyNames.ArrayType : PropertyNames.ObjectType);
writer.WritePropertyName(PropertyNames.Low);
writer.WriteValue((long)complexResumeValue.HashValue.GetLow());
writer.WritePropertyName(PropertyNames.High);
Expand Down Expand Up @@ -328,11 +328,11 @@ public SqlQueryResumeValue Visit(CosmosObject cosmosObject)

if (string.Equals(objectType.Value, PropertyNames.ArrayType))
{
return ComplexResumeValue.Create(bArray: true, hashValue);
return ComplexResumeValue.Create(isArray: true, hashValue);
}
else if (string.Equals(objectType.Value, PropertyNames.ObjectType))
{
return ComplexResumeValue.Create(bArray: false, hashValue);
return ComplexResumeValue.Create(isArray: false, hashValue);
}
else
{
Expand Down

0 comments on commit b5b9159

Please sign in to comment.