Skip to content

Commit 8719dd0

Browse files
committed
Constifying parts of ArcArena<T>:
1. `ArcArena<T>::block_size_` 2. `ArcArena<T>::size() 3. All data members of `ArcArenaStateStore<T>::State`. PiperOrigin-RevId: 878755339
1 parent 10ab7d8 commit 8719dd0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

openfst/lib/arc-arena.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class ArcArena {
102102

103103
void DropArcs() { next_ = arcs_; }
104104

105-
size_t Size() { return total_size_; }
105+
size_t Size() const { return total_size_; }
106106

107107
void Clear() {
108108
blocks_.resize(1);
@@ -137,7 +137,7 @@ class ArcArena {
137137
Arc* arcs_;
138138
Arc* next_;
139139
const Arc* end_;
140-
size_t block_size_;
140+
const size_t block_size_;
141141
size_t first_block_size_;
142142
size_t total_size_;
143143
size_t max_retained_size_;
@@ -183,10 +183,10 @@ class ArcArenaStateStore {
183183
narcs_(narcs),
184184
arcs_(arcs) {}
185185

186-
Weight final_weight_;
187-
size_t niepsilons_;
188-
size_t noepsilons_;
189-
size_t narcs_;
186+
const Weight final_weight_;
187+
const size_t niepsilons_;
188+
const size_t noepsilons_;
189+
const size_t narcs_;
190190
const Arc* arcs_;
191191

192192
friend class ArcArenaStateStore<Arc>;

0 commit comments

Comments
 (0)