@@ -106,7 +106,7 @@ class IndexAccessDense : public IndexAccess<TValue> {
106106 ~IndexAccessDense () noexcept override = default ;
107107
108108 void dump () const override {
109- index_type index{this ->fd ()};
109+ const index_type index{this ->fd ()};
110110
111111 for (std::size_t i = 0 ; i < index.size (); ++i) {
112112 if (index.get (i) != TValue{}) {
@@ -116,7 +116,7 @@ class IndexAccessDense : public IndexAccess<TValue> {
116116 }
117117
118118 bool search (const osmium::unsigned_object_id_type& key) const override {
119- index_type index{this ->fd ()};
119+ const index_type index{this ->fd ()};
120120
121121 try {
122122 TValue value = index.get (key);
@@ -153,7 +153,7 @@ class IndexAccessSparse : public IndexAccess<TValue> {
153153 ~IndexAccessSparse () noexcept override = default ;
154154
155155 void dump () const override {
156- index_type index{this ->fd ()};
156+ const index_type index{this ->fd ()};
157157
158158 for (const auto & element : index) {
159159 std::cout << element.first << " " << element.second << " \n " ;
@@ -164,7 +164,7 @@ class IndexAccessSparse : public IndexAccess<TValue> {
164164 using element_type = typename index_type::element_type;
165165 index_type index{this ->fd ()};
166166
167- element_type elem{key, TValue{}};
167+ const element_type elem{key, TValue{}};
168168 const auto positions = std::equal_range (index.begin (),
169169 index.end (),
170170 elem,
@@ -347,7 +347,7 @@ int run(const IndexAccess<TValue>& index, const Options& options) {
347347
348348int main (int argc, char * argv[]) {
349349 // Parse command line options.
350- Options options{argc, argv};
350+ const Options options{argc, argv};
351351
352352 // Open the index file.
353353 const int fd = ::open (options.filename (), O_RDWR);
0 commit comments