predictivesearch/PcsUtils/src/CPsData.cpp
branchRCL_3
changeset 6 e8e3147d53eb
parent 0 e686773b3f54
child 12 4ae315f230bc
--- a/predictivesearch/PcsUtils/src/CPsData.cpp	Fri Mar 12 15:41:25 2010 +0200
+++ b/predictivesearch/PcsUtils/src/CPsData.cpp	Mon Mar 15 12:39:26 2010 +0200
@@ -24,6 +24,7 @@
 
 #include "CPsData.h"
 #include "CPcsDefs.h"
+
 // ============================== MEMBER FUNCTIONS ============================
 
 
@@ -324,7 +325,7 @@
         if( !compareRes )
             {
             break;
-			}
+            }
         }
     return compareRes;
 }
@@ -342,18 +343,17 @@
 	
 	return EFalse;
 }
-				     
+
 
 // ----------------------------------------------------------------------------
 // CPsData::IsDataMatch
 // Return TRUE if data is matched for predictive search
 // ----------------------------------------------------------------------------		
 EXPORT_C TBool CPsData::IsDataMatch(TInt aIndex)
-{	
-    TReal val;
-	Math::Pow(val, 2, aIndex);
-
-	return(iDataMatches & (TUint8)val);
+{
+    __ASSERT_DEBUG( aIndex < 8, User::Panic( _L("CPsData"), KErrOverflow ) );
+    TUint8 val = 1 << aIndex;
+    return (iDataMatches & val);
 }
 
 // ----------------------------------------------------------------------------
@@ -370,11 +370,10 @@
 // 
 // ----------------------------------------------------------------------------
 EXPORT_C void CPsData::SetDataMatch(TInt aIndex)
-{	
-    TReal val;
-	Math::Pow(val, 2, aIndex);
-
-	iDataMatches |= (TUint8)val;
+{
+    __ASSERT_DEBUG( aIndex < 8, User::Panic( _L("CPsData"), KErrOverflow ) );
+    TUint8 val = 1 << aIndex;
+    iDataMatches |= val;
 }
 
 // ----------------------------------------------------------------------------