MCPcopy Create free account
hub / github.com/BruceDevices/firmware / removeQrCodeEntry

Method removeQrCodeEntry

src/core/config.cpp:828–843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

826}
827
828void BruceConfig::removeQrCodeEntry(const String &menuName) {
829 size_t writeIndex = 0;
830
831 for (size_t readIndex = 0; readIndex < qrCodes.size(); ++readIndex) {
832 const QrCodeEntry &entry = qrCodes[readIndex];
833
834 if (entry.menuName != menuName) {
835 if (writeIndex != readIndex) { qrCodes[writeIndex] = std::move(qrCodes[readIndex]); }
836 ++writeIndex;
837 }
838 }
839
840 if (writeIndex < qrCodes.size()) { qrCodes.erase(qrCodes.begin() + writeIndex, qrCodes.end()); }
841
842 saveFile();
843}
844
845void BruceConfig::addWebUISession(const String &token) {
846 webUISessions.push_back(token);

Callers 1

remove_custom_qrcodeFunction · 0.80

Calls 4

sizeMethod · 0.80
eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected