From 46aae486a5563f5ed5ec00c93734e6d756e50687 Mon Sep 17 00:00:00 2001 From: craftablescience Date: Thu, 11 Jul 2024 04:14:06 -0400 Subject: [PATCH] fix(kvpp): use an unsigned int instead of a std::size_t for indexing --- include/kvpp/kvpp.h | 2 +- src/kvpp/kvpp.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/kvpp/kvpp.h b/include/kvpp/kvpp.h index 4639238dd..33d258a6f 100644 --- a/include/kvpp/kvpp.h +++ b/include/kvpp/kvpp.h @@ -53,7 +53,7 @@ class KV1Element { [[nodiscard]] const std::vector& getChildren() const; /// Get the child element of the element at the given index - [[nodiscard]] const KV1Element& operator[](std::size_t index) const; + [[nodiscard]] const KV1Element& operator[](unsigned int n) const; /// Get the first child element of the element with the given key [[nodiscard]] const KV1Element& operator[](std::string_view childKey) const; diff --git a/src/kvpp/kvpp.cpp b/src/kvpp/kvpp.cpp index 8c0657810..3195080c2 100644 --- a/src/kvpp/kvpp.cpp +++ b/src/kvpp/kvpp.cpp @@ -41,8 +41,8 @@ const std::vector& KV1Element::getChildren() const { return this->children; } -const KV1Element& KV1Element::operator[](std::size_t index) const { - return this->children.at(index); +const KV1Element& KV1Element::operator[](unsigned int n) const { + return this->children.at(n); } const KV1Element& KV1Element::operator[](std::string_view childKey) const {