mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Minor optimization in wrap_text.cpp
This commit is contained in:
parent
4ccde48485
commit
437818aa45
1 changed files with 4 additions and 0 deletions
|
@ -143,6 +143,10 @@ void WordWrapper::Wrap() {
|
|||
|
||||
// First, let's check if it fits as-is.
|
||||
size_t len = strlen(str_);
|
||||
|
||||
// We know it'll be approximately this size. It's fine if the guess is a little off.
|
||||
out_.reserve(len + len / 16);
|
||||
|
||||
if (MeasureWidth(str_, len) <= maxW_) {
|
||||
// If it fits, we don't need to go through each character.
|
||||
out_ = str_;
|
||||
|
|
Loading…
Add table
Reference in a new issue