@@ -203,23 +203,23 @@ UnkeyedValidPathInfo UnkeyedValidPathInfo::fromJSON(const StoreDirConfig & store
203203
204204 // New format as this as nullable but mandatory field; handling
205205 // missing is for back-compat.
206- if (json. contains ( " ca" ))
207- if (auto * rawCa = getNullable (valueAt (json, " ca " ) ))
206+ if (auto * rawCa0 = optionalValueAt (json, " ca" ))
207+ if (auto * rawCa = getNullable (*rawCa0 ))
208208 res.ca = ContentAddress::parse (getString (*rawCa));
209209
210- if (json. contains ( " deriver" ))
211- if (auto * rawDeriver = getNullable (valueAt (json, " deriver " ) ))
210+ if (auto * rawDeriver0 = optionalValueAt (json, " deriver" ))
211+ if (auto * rawDeriver = getNullable (*rawDeriver0 ))
212212 res.deriver = store.parseStorePath (getString (*rawDeriver));
213213
214- if (json. contains ( " registrationTime" ))
215- if (auto * rawRegistrationTime = getNullable (valueAt (json, " registrationTime " ) ))
214+ if (auto * rawRegistrationTime0 = optionalValueAt (json, " registrationTime" ))
215+ if (auto * rawRegistrationTime = getNullable (*rawRegistrationTime0 ))
216216 res.registrationTime = getInteger<time_t >(*rawRegistrationTime);
217217
218- if (json. contains ( " ultimate" ))
219- res.ultimate = getBoolean (valueAt (json, " ultimate " ) );
218+ if (auto * rawUltimate = optionalValueAt (json, " ultimate" ))
219+ res.ultimate = getBoolean (*rawUltimate );
220220
221- if (json. contains ( " signatures" ))
222- res.sigs = getStringSet (valueAt (json, " signatures " ) );
221+ if (auto * rawSignatures = optionalValueAt (json, " signatures" ))
222+ res.sigs = getStringSet (*rawSignatures );
223223
224224 return res;
225225}
0 commit comments