Skip to content

Commit

Permalink
Nonsubstantive code edits
Browse files Browse the repository at this point in the history
  • Loading branch information
peteroupc committed Feb 2, 2025
1 parent 908eb07 commit 20836f2
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 98 deletions.
2 changes: 1 addition & 1 deletion CBOR/PeterO/Cbor/CBORDataUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ internal static string ToStringHelper(CBORObject obj, int depth) {
if (depth >= 50) {
_ = sb.Append("...");
} else {
ICollection<KeyValuePair<CBORObject, CBORObject >> entries =
ICollection<KeyValuePair<CBORObject, CBORObject>> entries =
obj.Entries;
foreach (KeyValuePair<CBORObject, CBORObject> entry
in entries) {
Expand Down
6 changes: 2 additions & 4 deletions CBOR/PeterO/Cbor/CBORDateConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -420,15 +420,13 @@ public CBORObject DateTimeFieldsToCBORObject(EInteger bigYear, int[]
CBORObject.FromFloatingPointBits(ef.ToDoubleBits(), 8)
.WithTag(1) :
CBORObject.FromFloatingPointBits(ef.ToDoubleBits(), 8);
default:
throw new CBORException ("Too big or small to fit an" +
default: throw new CBORException("Too big or small to fit an" +
"\u0020integer" + "\u0020or floating-point number");
}
} catch (ArgumentException ex) {
throw new CBORException(ex.Message, ex);
}
default:
throw new CBORException ("Internal error");
default: throw new CBORException("Internal error");
}
} catch (ArgumentException ex) {
throw new CBORException(ex.Message, ex);
Expand Down
9 changes: 3 additions & 6 deletions CBOR/PeterO/Cbor/CBORJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,7 @@ private CBORObject NextJSONValue(
}
return obj;
}
default:
this.RaiseError("Value can't be parsed.");
default: this.RaiseError("Value can't be parsed.");
break;
}
return null;
Expand Down Expand Up @@ -640,8 +639,7 @@ private CBORObject ParseJSONObject(int depth) {
break;
case '}':
return CBORObject.FromRaw(myHashMap);
default:
this.RaiseError ("Expected a ',' or '}'");
default: this.RaiseError("Expected a ',' or '}'");
break;
}
}
Expand Down Expand Up @@ -680,8 +678,7 @@ internal CBORObject ParseJSONArray(int depth) {
break;
case ']':
return CBORObject.FromRaw(myArrayList);
default:
this.RaiseError ("Expected a ',' or ']'");
default: this.RaiseError("Expected a ',' or ']'");
break;
}
}
Expand Down
6 changes: 2 additions & 4 deletions CBOR/PeterO/Cbor/CBORJson2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,7 @@ private CBORObject ParseJSONObject(int depth) {
break;
case '}':
return CBORObject.FromRaw(myHashMap);
default:
this.RaiseError ("Expected a ',' or '}'");
default: this.RaiseError("Expected a ',' or '}'");
break;
}
}
Expand Down Expand Up @@ -758,8 +757,7 @@ internal CBORObject ParseJSONArray(int depth) {
break;
case ']':
return CBORObject.FromRaw(myArrayList);
default:
this.RaiseError ("Expected a ',' or ']'");
default: this.RaiseError("Expected a ',' or ']'");
break;
}
}
Expand Down
6 changes: 2 additions & 4 deletions CBOR/PeterO/Cbor/CBORJson3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,7 @@ private CBORObject ParseJSONObject(int depth) {
break;
case '}':
return CBORObject.FromRaw(myHashMap);
default:
this.RaiseError ("Expected a ',' or '}'");
default: this.RaiseError("Expected a ',' or '}'");
break;
}
}
Expand Down Expand Up @@ -656,8 +655,7 @@ internal CBORObject ParseJSONArray(int depth) {
break;
case ']':
return CBORObject.FromRaw(myArrayList);
default:
this.RaiseError ("Expected a ',' or ']'");
default: this.RaiseError("Expected a ',' or ']'");
break;
}
}
Expand Down
5 changes: 2 additions & 3 deletions CBOR/PeterO/Cbor/CBORJsonWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ internal static void WriteJSONToInternal(
{
var first = true;
var hasNonStringKeys = false;
ICollection<KeyValuePair<CBORObject, CBORObject >> entries =
ICollection<KeyValuePair<CBORObject, CBORObject>> entries =
obj.Entries;
foreach (KeyValuePair<CBORObject, CBORObject> entry in entries) {
CBORObject key = entry.Key;
Expand Down Expand Up @@ -293,8 +293,7 @@ internal static void WriteJSONToInternal(
str = sb.ToString();
break;
}
default:
str = key.ToJSONString (options);
default: str = key.ToJSONString(options);
break;
}
if (stringMap.ContainsKey(str)) {
Expand Down
6 changes: 2 additions & 4 deletions CBOR/PeterO/Cbor/CBORNumber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ private static CBORNumber RationalToNumber(
options >= 6,
options == 5 || options == 7);
break;
default:
return null; // "Invalid options");
default: return null; // "Invalid options");
}
return CBORNumber.FromERational(erat);
} else {
Expand Down Expand Up @@ -1605,8 +1604,7 @@ public int CompareTo(CBORNumber other) {
(ERational)objB);
break;
}
default:
throw new InvalidOperationException (
default: throw new InvalidOperationException(
"Unexpected data type");
}
} else {
Expand Down
Loading

0 comments on commit 20836f2

Please sign in to comment.