summaryrefslogtreecommitdiffstats
path: root/src/item.hpp
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-03-31 00:01:18 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-03-31 00:01:18 +0200
commit63640911b950905057f2ca925e0b2b2c530721ec (patch)
treefcb753714e901e4d82e2b63e6dece98614672b39 /src/item.hpp
parent8de90acc6791a62d4b2e48e9bd05daa0d5cfe4b6 (diff)
downloadsolar-63640911b950905057f2ca925e0b2b2c530721ec.tar
solar-63640911b950905057f2ca925e0b2b2c530721ec.zip
Don't create items with point at end
Diffstat (limited to 'src/item.hpp')
-rw-r--r--src/item.hpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/item.hpp b/src/item.hpp
index 58987b8..faebf79 100644
--- a/src/item.hpp
+++ b/src/item.hpp
@@ -61,7 +61,7 @@ struct item_t : public std::tuple<std::string, std::vector<symbol_t>, unsigned>
return std::get<2>(*this);
}
- bool can_shift() const {
+ bool has_next() const {
return get_point() < get_rhs().size();
}
@@ -70,10 +70,7 @@ struct item_t : public std::tuple<std::string, std::vector<symbol_t>, unsigned>
}
symbol_t get_next_symbol() const {
- if (can_shift())
- return get_rhs()[get_point()];
- else
- return symbol_t::make_end();
+ return get_rhs()[get_point()];
}
};