aboutsummaryrefslogtreecommitdiff
path: root/src/cppbor_parse.cpp
diff options
context:
space:
mode:
authorShawn Willden <swillden@google.com>2020-12-01 08:14:39 -0700
committerShawn Willden <swillden@google.com>2020-12-01 10:55:14 -0700
commitc5a4a3f24e82ba4bd8f01cf3a95a987adc0670f6 (patch)
tree761a7313a14d4e6c2314cbd483fdef89a453f8fd /src/cppbor_parse.cpp
parentd613c9aa818172289b6f653ac15853b7c5bd1f36 (diff)
downloadlibcppbor-c5a4a3f24e82ba4bd8f01cf3a95a987adc0670f6.tar.gz
Remove CompoundItem.
Refactor to remove CompoundItem. It was a way to share some common code between Array and Map, and later Semantic, but the representations of those classes need to diverge so it adds no value. Test: cppbor_test_external Change-Id: I986e90c1d212f6d81debe4b2f650ba68f065a6ed
Diffstat (limited to 'src/cppbor_parse.cpp')
-rw-r--r--src/cppbor_parse.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/cppbor_parse.cpp b/src/cppbor_parse.cpp
index 357b9ee..488f8c7 100644
--- a/src/cppbor_parse.cpp
+++ b/src/cppbor_parse.cpp
@@ -280,10 +280,7 @@ class FullParseClient : public ParseClient {
// Starting a new compound data item, i.e. a new parent. Save it on the parent stack.
// It's safe to save a raw pointer because the unique_ptr is guaranteed to stay in
// existence until the corresponding itemEnd() call.
-#if __has_feature(cxx_rtti)
- assert(dynamic_cast<CompoundItem*>(item.get()));
-#endif
- mParentStack.push(static_cast<CompoundItem*>(item.get()));
+ mParentStack.push(item.get());
return this;
} else {
appendToLastParent(std::move(item));
@@ -336,7 +333,7 @@ class FullParseClient : public ParseClient {
}
std::unique_ptr<Item> mTheItem;
- std::stack<CompoundItem*> mParentStack;
+ std::stack<Item*> mParentStack;
const uint8_t* mPosition = nullptr;
std::string mErrorMessage;
};