MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / set

Method set

libraries/SparseArray/SparseArray.cpp:66–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64
65
66bool SparseArray::set(uint16_t x, float value)
67{
68 int32_t pos = findPos(x);
69 // existing element
70 if (pos > -1)
71 {
72 _value[pos] = value;
73 if (_value[pos] == 0.0) removeElement(pos);
74 return true;
75 }
76
77 // does not exist => new element ?
78 return newElement(x, value);
79}
80
81
82bool SparseArray::add(uint16_t x, float value)

Callers 1

unittestFunction · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36