aboutsummaryrefslogtreecommitdiff
path: root/src/Text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text.cpp')
-rw-r--r--src/Text.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text.cpp b/src/Text.cpp
index 9ea4847..f78c6b7 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -504,7 +504,7 @@ namespace dchat
return textElements[0].text.size == 0 || caretIndex == textElements[0].text.size;
}
- // TODO: This can be optimized by using step algorithm (jump to middle of vertices list and check if it's at next row, if not then divide by 2 again, and do this recursively)
+ // TODO: This can be optimized by using binary search
int Text::getStartOfLine(int startIndex) const
{
assert(!dirty && !dirtyText);
@@ -526,7 +526,7 @@ namespace dchat
return 0;
}
- // TODO: This can be optimized by using step algorithm (jump to middle of vertices list and check if it's at next row, if not then divide by 2 again, and do this recursively)
+ // TODO: This can be optimized by using binary search
int Text::getEndOfLine(int startIndex) const
{
assert(!dirty && !dirtyText);
@@ -548,7 +548,7 @@ namespace dchat
return numVertices / 4;
}
- // TODO: This can be optimized by using step algorithm (jump to middle of vertices list and check if it's at next row, if not then divide by 2 again, and do this recursively)
+ // TODO: This can be optimized by using binary search
int Text::getPreviousLineClosestPosition(int startIndex) const
{
assert(!dirty && !dirtyText);
@@ -582,7 +582,7 @@ namespace dchat
return 0;
}
- // TODO: This can be optimized by using step algorithm (jump to middle of vertices list and check if it's at next row, if not then divide by 2 again, and do this recursively)
+ // TODO: This can be optimized by using binary search
int Text::getNextLineClosestPosition(int startIndex) const
{
assert(!dirty && !dirtyText);