MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / add

Method add

Source/ThirdParty/pugixml/pugixml.cpp:11271–11293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11269 }
11270
11271 PUGI__FN xpath_variable* xpath_variable_set::add(const char_t* name, xpath_value_type type)
11272 {
11273 const size_t hash_size = sizeof(_data) / sizeof(_data[0]);
11274 size_t hash = impl::hash_string(name) % hash_size;
11275
11276 // look for existing variable
11277 for (xpath_variable* var = _data[hash]; var; var = var->_next)
11278 if (impl::strequal(var->name(), name))
11279 return var->type() == type ? var : 0;
11280
11281 // add new variable
11282 xpath_variable* result = impl::new_xpath_variable(type, name);
11283
11284 if (result)
11285 {
11286 result->_type = type;
11287 result->_next = _data[hash];
11288
11289 _data[hash] = result;
11290 }
11291
11292 return result;
11293 }
11294
11295 PUGI__FN bool xpath_variable_set::set(const char_t* name, bool value)
11296 {

Callers

nothing calls this directly

Calls 5

hash_stringFunction · 0.85
new_xpath_variableFunction · 0.85
strequalFunction · 0.70
nameMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected