KDevelop-PG-Location-Table::positionAt updated with new combined relative/binary algorithm

Jonathan Schmidt-Dominé - Developer devel at the-user.org
Fri Nov 20 21:18:03 UTC 2009


Hi!

It seems to be buggy.
I had a never-ending loop. This may help, but I'm not sure:
      while ( !(lines[i] <= offset && lines[i + 1] > offset) ) {
        if ( lines[i] < offset ) {
          lowerBound = i;
          i += float(upperBound - lowerBound) / 2 + 1;
        } else {
          upperBound = i;
          i -= float(upperBound - lowerBound) / 2 + 1;
        }
      }
Or:
if(upperBound == lowerBound)
  break;

The User

------------------------

Automatisch eingefügte Signatur:
Es lebe die Freiheit!
Stoppt den Gebrauch proprietärer Software!
Operating System: GNU/Linux
Kernel: Linux 2.6.31-ARCH
Distribution: Arch Linux
Qt: 4.6.0
KDE: 4.3.73 (KDE 4.3.73 (KDE 4.4 >= 20091026))
KMail: 1.12.90
http://gnu.org/
http://kde.org/
http://windows7sins.org/





More information about the KDevelop-devel mailing list