another 8% or so when loading the UserGuide...

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4271 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-05-29 14:58:21 +00:00
parent b6b0e583fd
commit 6ef49d59c2
2 changed files with 6 additions and 4 deletions

View File

@ -1141,8 +1141,7 @@ int Paragraph::beginningOfMainBody() const
// and remember the previous character to
// remove unnecessary GetChar() calls
pos_type i = 0;
if (i < size()
&& getChar(i) != Paragraph::META_NEWLINE) {
if (i < size() && getChar(i) != Paragraph::META_NEWLINE) {
++i;
char previous_char = 0;
char temp = 0;

View File

@ -89,13 +89,16 @@ void Paragraph::Pimpl::setContentsFromPar(Paragraph const * par)
Paragraph::value_type Paragraph::Pimpl::getChar(pos_type pos) const
{
lyx::Assert(pos <= size());
// This is in the critical path for loading!
pos_type siz = size();
lyx::Assert(pos <= siz);
// This is stronger, and I belive that this is the assertion
// that we should really use. (Lgb)
//Assert(pos < size());
// Then this has no meaning. (Lgb)
if (!size() || pos == size()) return '\0';
if (!siz || pos == siz)
return '\0';
return text[pos];
}