Преглед изворни кода

Assert statement calls a function which may have desired side effects: 'pos_is_okay'

It does not have any desired sideeffect, so we just mark it as const to
properly advertise this fact to developer, compiler and linter alike.

Reported-By: cppcheck
Git-Dch: Ignore
David Kalnischkies пре 11 година
родитељ
комит
9dd940ed72
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      methods/rred.cc

+ 2 - 2
methods/rred.cc

@@ -150,11 +150,11 @@ class FileChanges {
    std::list<struct Change>::iterator where;
    size_t pos; // line number is as far left of iterator as possible
 
-   bool pos_is_okay(void)
+   bool pos_is_okay(void) const
    {
 #ifdef POSDEBUG
       size_t cpos = 0;
-      std::list<struct Change>::iterator x;
+      std::list<struct Change>::const_iterator x;
       for (x = changes.begin(); x != where; ++x) {
 	 assert(x != changes.end());
 	 cpos += x->offset + x->add_cnt;