Formatted API
[platform/core/uifw/dali-core.git] / dali / devel-api / common / hash.cpp
index 3b8b3bd..cc2740f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 namespace Dali
 {
-
 namespace //unnamed namespace
 {
-
 /*
  * djb2 (http://www.cse.yorku.ca/~oz/hash.html)
  */
 
-inline void HashString( const char* string, std::size_t& hash )
+inline void HashString(const char* string, std::size_t& hash)
 {
-  while( int c = *string++ )
+  while(int c = *string++)
   {
     hash = hash * 33 + c;
   }
@@ -38,21 +36,21 @@ inline void HashString( const char* string, std::size_t& hash )
 
 } // unnamed namespace
 
-std::size_t CalculateHash( const std::string& toHash)
+std::size_t CalculateHash(const std::string& toHash)
 {
-  std::size_t hash( INITIAL_HASH_VALUE );
+  std::size_t hash(INITIAL_HASH_VALUE);
 
-  HashString( toHash.c_str(), hash );
+  HashString(toHash.c_str(), hash);
 
   return hash;
 }
 
-std::size_t CalculateHash( const std::string& string1, const std::string& string2 )
+std::size_t CalculateHash(const std::string& string1, const std::string& string2)
 {
-  std::size_t hash( INITIAL_HASH_VALUE );
+  std::size_t hash(INITIAL_HASH_VALUE);
 
-  HashString( string1.c_str(), hash);
-  HashString( string2.c_str(), hash );
+  HashString(string1.c_str(), hash);
+  HashString(string2.c_str(), hash);
 
   return hash;
 }