preprocessor: avoid branches in tight code

Change-Id: I8dc0910f1cf11e506eb415a6f313b47ad2d41eae
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
hjk
2012-04-16 11:33:36 +02:00
committed by hjk
parent 0b8d8568af
commit 59debcd0e9
2 changed files with 14 additions and 16 deletions

View File

@@ -4,11 +4,7 @@
using namespace CPlusPlus::Internal;
ByteArrayRef::ByteArrayRef()
: m_ref(0)
, m_offset(0)
, m_length(0)
{}
const QByteArray ByteArrayRef::m_emptyByteArray;
bool ByteArrayRef::startsWith(const char *s) const
{
@@ -20,9 +16,6 @@ bool ByteArrayRef::startsWith(const char *s) const
int ByteArrayRef::count(char ch) const
{
if (!m_ref)
return 0;
int num = 0;
const char *b = start();
const char *i = b + m_length;