Skip to content

Commit 95a006d

Browse files
authored
Fixed some static field names (#8331)
1 parent 75d4592 commit 95a006d

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/HotChocolate/Core/src/Types.Scalars/UtcOffsetType.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ public override bool TryDeserialize(object? resultValue, out object? runtimeValu
108108

109109
private static class OffsetLookup
110110
{
111-
private static readonly IReadOnlyDictionary<TimeSpan, string> _timeSpanToOffset;
112-
private static readonly IReadOnlyDictionary<string, TimeSpan> _offsetToTimeSpan;
111+
private static readonly IReadOnlyDictionary<TimeSpan, string> s_timeSpanToOffset;
112+
private static readonly IReadOnlyDictionary<string, TimeSpan> s_offsetToTimeSpan;
113113

114114
static OffsetLookup()
115115
{
116-
_timeSpanToOffset = new Dictionary<TimeSpan, string>
116+
s_timeSpanToOffset = new Dictionary<TimeSpan, string>
117117
{
118118
{ new TimeSpan(-12, 0, 0), "-12:00" },
119119
{ new TimeSpan(-11, 0, 0), "-11:00" },
@@ -155,27 +155,27 @@ static OffsetLookup()
155155
{ new TimeSpan(14, 0, 0), "+14:00" },
156156
};
157157

158-
var offsetToTimeSpan = _timeSpanToOffset
158+
var offsetToTimeSpan = s_timeSpanToOffset
159159
.Reverse()
160160
.ToDictionary(x => x.Value, x => x.Key);
161161
offsetToTimeSpan["-00:00"] = TimeSpan.Zero;
162162
offsetToTimeSpan["00:00"] = TimeSpan.Zero;
163163

164-
_offsetToTimeSpan = offsetToTimeSpan;
164+
s_offsetToTimeSpan = offsetToTimeSpan;
165165
}
166166

167167
public static bool TrySerialize(
168168
TimeSpan value,
169169
[NotNullWhen(true)] out string? result)
170170
{
171-
return _timeSpanToOffset.TryGetValue(value, out result);
171+
return s_timeSpanToOffset.TryGetValue(value, out result);
172172
}
173173

174174
public static bool TryDeserialize(
175175
string value,
176176
[NotNullWhen(true)] out TimeSpan result)
177177
{
178-
return _offsetToTimeSpan.TryGetValue(value, out result);
178+
return s_offsetToTimeSpan.TryGetValue(value, out result);
179179
}
180180
}
181181
}

src/HotChocolate/Language/src/Language.SyntaxTree/DirectiveLocation.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ namespace HotChocolate.Language;
55

66
public sealed class DirectiveLocation : IEquatable<DirectiveLocation?>
77
{
8-
private static readonly Dictionary<string, DirectiveLocation> _cache;
8+
private static readonly Dictionary<string, DirectiveLocation> s_cache;
99

1010
static DirectiveLocation()
1111
{
12-
_cache = GetAll().ToDictionary(t => t.Value);
12+
s_cache = GetAll().ToDictionary(t => t.Value);
1313
}
1414

1515
private DirectiveLocation(string value)
@@ -105,14 +105,14 @@ public override int GetHashCode()
105105
public static DirectiveLocation InputFieldDefinition { get; } = new("INPUT_FIELD_DEFINITION");
106106

107107
public static bool IsValidName(string value)
108-
=> _cache.ContainsKey(value);
108+
=> s_cache.ContainsKey(value);
109109

110110
#if NETSTANDARD2_0
111111
public static bool TryParse(string value, out DirectiveLocation? location)
112112
#else
113113
public static bool TryParse(string value, [NotNullWhen(true)] out DirectiveLocation? location)
114114
#endif
115-
=> _cache.TryGetValue(value, out location);
115+
=> s_cache.TryGetValue(value, out location);
116116

117117
private static IEnumerable<DirectiveLocation> GetAll()
118118
{

0 commit comments

Comments
 (0)