From cda15af9657880e91ccf65603e109b202d9e78bf Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 6 Apr 2017 21:04:37 +1000 Subject: Added const where possible. --- src/RunStyles.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/RunStyles.cxx') diff --git a/src/RunStyles.cxx b/src/RunStyles.cxx index aa0177ca1..01eab156a 100644 --- a/src/RunStyles.cxx +++ b/src/RunStyles.cxx @@ -38,7 +38,7 @@ int RunStyles::RunFromPosition(int position) const { // If there is no run boundary at position, insert one continuing style. int RunStyles::SplitRun(int position) { int run = RunFromPosition(position); - int posRun = starts->PositionFromPartition(run); + const int posRun = starts->PositionFromPartition(run); if (posRun < position) { int runStyle = ValueAt(position); run++; @@ -91,12 +91,12 @@ int RunStyles::ValueAt(int position) const { } int RunStyles::FindNextChange(int position, int end) const { - int run = starts->PartitionFromPosition(position); + const int run = starts->PartitionFromPosition(position); if (run < starts->Partitions()) { - int runChange = starts->PositionFromPartition(run); + const int runChange = starts->PositionFromPartition(run); if (runChange > position) return runChange; - int nextChange = starts->PositionFromPartition(run + 1); + const int nextChange = starts->PositionFromPartition(run + 1); if (nextChange > position) { return nextChange; } else if (position < end) { @@ -273,7 +273,7 @@ void RunStyles::Check() const { } int start=0; while (start < Length()) { - int end = EndRun(start); + const int end = EndRun(start); if (start >= end) { throw std::runtime_error("RunStyles: Partition is 0 length."); } -- cgit v1.2.3