--- a/predictivesearch/PcsAlgorithm/Algorithm2/src/CPcsPoolElement.cpp Thu Jul 15 18:22:55 2010 +0300
+++ b/predictivesearch/PcsAlgorithm/Algorithm2/src/CPcsPoolElement.cpp Thu Aug 19 09:41:07 2010 +0300
@@ -79,20 +79,19 @@
// ----------------------------------------------------------------------------
TInt CPcsPoolElement::CompareByData ( const CPcsPoolElement& aObject1, const CPcsPoolElement& aObject2 )
{
- CPsData *data1 = const_cast<CPcsPoolElement&> (aObject1).GetPsData();
- CPsData *data2 = const_cast<CPcsPoolElement&> (aObject2).GetPsData();
- return (CPcsAlgorithm2Utils::CompareDataBySortOrder(*(data1), *(data2)));
+ CPsData *data1 = const_cast<CPcsPoolElement&> (aObject1).GetPsData();
+ CPsData *data2 = const_cast<CPcsPoolElement&> (aObject2).GetPsData();
+ return (CPcsAlgorithm2Utils::CompareDataBySortOrder(*(data1), *(data2)));
}
// CPcsPoolElement::IsDataMatch
//
// ----------------------------------------------------------------------------
-TBool CPcsPoolElement::IsDataMatch (TInt aIndex)
+TBool CPcsPoolElement::IsDataMatch(TInt aIndex)
{
- TReal val;
- Math::Pow(val, 2, aIndex);
-
- return(iDataMatchAttribute & (TUint8)val);
+ __ASSERT_DEBUG( aIndex < 8, User::Panic( _L("CPcsPoolElement"), KErrOverflow ) );
+ TUint8 val = 1 << aIndex;
+ return (iDataMatchAttribute & val);
}
// ----------------------------------------------------------------------------
@@ -101,10 +100,9 @@
// ----------------------------------------------------------------------------
void CPcsPoolElement::SetDataMatch(TInt aIndex)
{
- TReal val;
- Math::Pow(val, 2, aIndex);
-
- iDataMatchAttribute |= (TUint8)val;
+ __ASSERT_DEBUG( aIndex < 8, User::Panic( _L("CPcsPoolElement"), KErrOverflow ) );
+ TUint8 val = 1 << aIndex;
+ iDataMatchAttribute |= val;
}
// ----------------------------------------------------------------------------