MCPcopy Create free account
hub / github.com/apple/foundationdb / setOption

Method setOption

fdbcli/fdbcli.actor.cpp:252–264  ·  view source on GitHub ↗

Enable or disable an option. Returns true if option value changed

Source from the content-addressed store, hash-verified

250
251 // Enable or disable an option. Returns true if option value changed
252 bool setOption(typename T::Option option, bool enabled, Optional<StringRef> arg) {
253 auto optionItr = options.find(option);
254 if (enabled && (optionItr == options.end() ||
255 Optional<Standalone<StringRef>>(optionItr->second).castTo<StringRef>() != arg)) {
256 options[option] = arg.castTo<Standalone<StringRef>>();
257 return true;
258 } else if (!enabled && optionItr != options.end()) {
259 options.erase(optionItr);
260 return true;
261 }
262
263 return false;
264 }
265
266 // Prints a list of all enabled options in this group
267 bool print() const {

Callers

nothing calls this directly

Calls 3

findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected