summaryrefslogtreecommitdiff
path: root/decoder/sparse_vector.h
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/sparse_vector.h')
-rw-r--r--decoder/sparse_vector.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/decoder/sparse_vector.h b/decoder/sparse_vector.h
index 285e84a7..f8310fc1 100644
--- a/decoder/sparse_vector.h
+++ b/decoder/sparse_vector.h
@@ -90,6 +90,10 @@ public:
return found->second;
}
+ T value(int index) const {
+ return (*this)[index];
+ }
+
void set_value(int index, const T &value) {
values_[index] = value;
}
@@ -101,13 +105,6 @@ public:
return val;
}
- T value(int index) const {
- typename MapType::const_iterator found = values_.find(index);
- if (found != values_.end())
- return found->second;
- else
- return 0;
- }
void store(std::valarray<T>* target) const {
(*target) *= 0;