• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bblanchon / ArduinoJson / 4655935094

pending completion
4655935094

push

github

Benoit Blanchon
Remove unused `MemoryPool::_left`

5 of 5 new or added lines in 1 file covered. (100.0%)

3305 of 3322 relevant lines covered (99.49%)

6124.39 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.12
/src/ArduinoJson/Variant/SlotFunctions.hpp
1
// ArduinoJson - https://arduinojson.org
2
// Copyright © 2014-2023, Benoit BLANCHON
3
// MIT License
4

5
#pragma once
6

7
#include <ArduinoJson/Polyfills/assert.hpp>
8
#include <ArduinoJson/Variant/VariantData.hpp>
9

10
ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
11

12
struct SlotKeySetter {
13
  SlotKeySetter(VariantSlot* instance) : _instance(instance) {}
774✔
14

15
  template <typename TStoredString>
16
  void operator()(TStoredString s) {
774✔
17
    if (!s)
774✔
18
      return;
×
19
    ARDUINOJSON_ASSERT(_instance != 0);
20
    _instance->setKey(s);
774✔
21
  }
22

23
  VariantSlot* _instance;
24
};
25

26
template <typename TAdaptedString>
27
inline bool slotSetKey(VariantSlot* var, TAdaptedString key, MemoryPool* pool) {
777✔
28
  if (!var)
777✔
29
    return false;
3✔
30
  return storeString(pool, key, SlotKeySetter(var));
774✔
31
}
32

33
inline size_t slotSize(const VariantSlot* var) {
297✔
34
  size_t n = 0;
297✔
35
  while (var) {
66,336✔
36
    n++;
66,039✔
37
    var = var->next();
66,039✔
38
  }
39
  return n;
297✔
40
}
41

42
inline VariantData* slotData(VariantSlot* slot) {
68,641✔
43
  return reinterpret_cast<VariantData*>(slot);
68,641✔
44
}
45
ARDUINOJSON_END_PRIVATE_NAMESPACE
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc