1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Misc performance tweaks.

This commit is contained in:
jules 2013-09-06 11:25:49 +01:00
parent 1356ae6387
commit 2fccfccbc0
5 changed files with 9 additions and 8 deletions

View file

@ -172,7 +172,7 @@ struct CoreAudioFormatMetatdata
}
if (tempoSequence.getDataSize() > 0)
midiMetadata.set ("tempo sequence", tempoSequence.toString());
midiMetadata.set ("tempo sequence", tempoSequence.toUTF8());
}
static double getTempoFromTempoMetaEvent (MidiMessageSequence::MidiEventHolder* holder)
@ -217,7 +217,7 @@ struct CoreAudioFormatMetatdata
}
if (timeSigSequence.getDataSize() > 0)
midiMetadata.set ("time signature sequence", timeSigSequence.toString());
midiMetadata.set ("time signature sequence", timeSigSequence.toUTF8());
}
//==============================================================================

View file

@ -316,7 +316,7 @@ private:
buffer.appendUTF8Char (c);
}
result = buffer.toString();
result = buffer.toUTF8();
return Result::ok();
}
};
@ -526,7 +526,7 @@ String JSON::toString (const var& data, const bool allOnOneLine)
{
MemoryOutputStream mo (1024);
JSONFormatter::write (mo, data, 0, allOnOneLine);
return mo.toString();
return mo.toUTF8();
}
void JSON::writeToStream (OutputStream& output, const var& data, const bool allOnOneLine)

View file

@ -175,7 +175,8 @@ String InputStream::readString()
}
}
return String::fromUTF8 (data, (int) i);
return String (CharPointer_UTF8 (data),
CharPointer_UTF8 (data + i));
}
String InputStream::readNextLine()

View file

@ -2385,7 +2385,7 @@ String TextEditor::getText() const
for (int i = 0; i < sections.size(); ++i)
sections.getUnchecked (i)->appendAllText (mo);
return mo.toString();
return mo.toUTF8();
}
String TextEditor::getTextInRange (const Range<int>& range) const
@ -2414,7 +2414,7 @@ String TextEditor::getTextInRange (const Range<int>& range) const
index = nextIndex;
}
return mo.toString();
return mo.toUTF8();
}
String TextEditor::getHighlightedText() const

View file

@ -522,7 +522,7 @@ String CodeDocument::getTextBetween (const Position& start, const Position& end)
}
}
return mo.toString();
return mo.toUTF8();
}
int CodeDocument::getNumCharacters() const noexcept