File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -98,11 +98,19 @@ proc getOption*(optionName; db; defaultValue: OptionValue = ""): OptionValue {.s
9898 db != nil
9999 body:
100100 type LocalOption = ref object
101- value: string
101+ value: OptionValue
102+ proc initLocalOption (value: OptionValue = " " ): LocalOption {.raises : [],
103+ tags : [], contractual .} =
104+ # # Initialize a new instance of LocalOption object
105+ # #
106+ # # * value - the value of the option. Default value is an empty string
107+ # #
108+ # # Returns the new instance of LocalOption object
109+ result = LocalOption (value: value)
102110 try :
103111 if not db.exists (T = Option , cond = " option=?" , params = $ optionName):
104112 return defaultValue
105- var option: LocalOption = LocalOption ()
113+ var option: LocalOption = initLocalOption ()
106114 db.rawSelect (qry = " SELECT value FROM options WHERE option=?" ,
107115 obj = option, params = $ optionName)
108116 result = option.value
You can’t perform that action at this time.
0 commit comments