Skip to content

Commit

Permalink
fix(kvpp): use an unsigned int instead of a std::size_t for indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
craftablescience committed Jul 11, 2024
1 parent cc0caa3 commit 46aae48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/kvpp/kvpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class KV1Element {
[[nodiscard]] const std::vector<KV1Element>& 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;
Expand Down
4 changes: 2 additions & 2 deletions src/kvpp/kvpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ const std::vector<KV1Element>& 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 {
Expand Down

0 comments on commit 46aae48

Please sign in to comment.