diff --git a/alib2algo/src/compare/string/CyclicStringCompare.cpp b/alib2algo/src/compare/string/CyclicStringCompare.cpp index 9c15baa629b4118c6f8ce25e9c9eb864cbf305a3..0e8fc8b879a6c37df39f19602558af4bf8d20191 100644 --- a/alib2algo/src/compare/string/CyclicStringCompare.cpp +++ b/alib2algo/src/compare/string/CyclicStringCompare.cpp @@ -2,7 +2,7 @@ * CyclicStringCompare.cpp * * Created on: Oct 9, 2014 - * Author: RadomĂr Polcáh */ + * Author: Radomir Polach */ #include "CyclicStringCompare.h" @@ -11,7 +11,7 @@ namespace compare { bool CyclicStringCompare::equals(const string::LinearString& u, const string::LinearString& v) { int n = (int)u.getContent().size(); int i = -1, j = -1, k; - if (n != v.getContent().size()) return false; + if (n != (int) v.getContent().size()) return false; while(i < n - 1 && j < n - 1) { @@ -24,7 +24,7 @@ bool CyclicStringCompare::equals(const string::LinearString& u, const string::Li } int CyclicStringCompare::compare(const string::LinearString& u, const string::LinearString& v) { - int n = (int)u.getContent().size(), m = (int)v.getContent().size(); + int n = (int) u.getContent().size(), m = (int)v.getContent().size(); int i = -1, j = -1, k; bool last = 0; @@ -33,7 +33,8 @@ int CyclicStringCompare::compare(const string::LinearString& u, const string::Li k = 1; while(k <= n && u.getContent()[(i + k) % n] == v.getContent()[(j + k) % m]) k++; if (k > n) return 0; - if (last = u.getContent()[(i + k) % n] > v.getContent()[(j + k) % m]) i += k; else j += k; + last = u.getContent()[(i + k) % n] > v.getContent()[(j + k) % m]; + if (last) i += k; else j += k; } return last ? 1 : - 1; } diff --git a/alib2algo/src/compare/string/CyclicStringCompare.h b/alib2algo/src/compare/string/CyclicStringCompare.h index 5b8cb145184df12139912721779b3bd913a064b4..18e062432185332ba40c38737496ee25aea62d60 100644 --- a/alib2algo/src/compare/string/CyclicStringCompare.h +++ b/alib2algo/src/compare/string/CyclicStringCompare.h @@ -2,7 +2,7 @@ * CyclicStringCompare.h * * Created on: Oct 14, 2014 - * Author: RadomĂr Polách + * Author: Radomir Polach */ #ifndef CYCLIC_STRING_COMPARE_H_