Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 390e2e0

Browse files
committed
Name things betterer
1 parent e37cfa8 commit 390e2e0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/GitHub.Api/Git/GitConfig.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ public bool TryGet<T>(string section, string key, out T value)
233233
if (ret)
234234
{
235235
if (value is float)
236-
value = (T)(object)sect.GetFloat(key);
236+
value = (T)(object)sect.TryGetFloat(key);
237237
else if (value is int)
238-
value = (T)(object)sect.GetInt(key);
238+
value = (T)(object)sect.TryGetInt(key);
239239
else
240240
value = (T)(object)sect.GetString(key);
241241
}
@@ -249,12 +249,12 @@ public string GetString(string section, string key)
249249

250250
public float GetFloat(string section, string key)
251251
{
252-
return sections[section].GetFloat(key);
252+
return sections[section].TryGetFloat(key);
253253
}
254254

255255
public int GetInt(string section, string key)
256256
{
257-
return sections[section].GetInt(key);
257+
return sections[section].TryGetInt(key);
258258
}
259259

260260
public void Set<T>(string section, string key, T value)
@@ -317,15 +317,15 @@ public string GetString(string key)
317317
return this[key].First();
318318
}
319319

320-
public int GetInt(string key)
320+
public int TryGetInt(string key)
321321
{
322322
var value = TryGetString(key);
323323
int result = 0;
324324
int.TryParse(value, out result);
325325
return result;
326326
}
327327

328-
public float GetFloat(string key)
328+
public float TryGetFloat(string key)
329329
{
330330
var value = TryGetString(key);
331331
float result = 0F;

0 commit comments

Comments
 (0)