mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-21 08:21:32 +00:00
Fixes #4265.
This commit is contained in:
@@ -129,7 +129,7 @@ proc mget*(t: StringTableRef, key: string): var string {.deprecated.} =
|
||||
## ``KeyError`` exception is raised. Use ```[]``` instead.
|
||||
get(t, key)
|
||||
|
||||
proc getOrDefault*(t: StringTableRef; key: string, default: string = ""): string =
|
||||
proc getOrDefault*(t: StringTableRef; key: string, default: string = nil): string =
|
||||
var index = rawGet(t, key)
|
||||
if index >= 0: result = t.data[index].val
|
||||
else: result = default
|
||||
|
||||
Reference in New Issue
Block a user