diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2015-12-27 18:39:47 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2015-12-27 18:40:08 +0900 |
| commit | b1132d6b10cd3791b9529d7031d723fd0e2d8215 (patch) | |
| tree | 9ce465b42bf09372118335c7c619bb2b41869eaf /src/HashFuncEntry.h | |
| parent | 4abad2f64c9ff80144a61c5a9c2bea144852b883 (diff) | |
make clang-format using clang-format-3.6
Diffstat (limited to 'src/HashFuncEntry.h')
| -rw-r--r-- | src/HashFuncEntry.h | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/src/HashFuncEntry.h b/src/HashFuncEntry.h index dfa86f46..3f280318 100644 --- a/src/HashFuncEntry.h +++ b/src/HashFuncEntry.h @@ -45,23 +45,22 @@ namespace aria2 { -template<typename HashFunc> -struct HashFuncEntry { +template <typename HashFunc> struct HashFuncEntry { typedef HashFunc HashFuncType; std::string hashType; HashFunc hashFunc; - HashFuncEntry(std::string hashType, const HashFunc& hashFunc): - hashType(std::move(hashType)), hashFunc(hashFunc) - {} + HashFuncEntry(std::string hashType, const HashFunc& hashFunc) + : hashType(std::move(hashType)), hashFunc(hashFunc) + { + } }; -template<typename HashFunc> -class FindHashFunc { +template <typename HashFunc> class FindHashFunc { private: const std::string& hashType_; + public: - FindHashFunc(const std::string& hashType):hashType_(hashType) - {} + FindHashFunc(const std::string& hashType) : hashType_(hashType) {} bool operator()(const HashFuncEntry<HashFunc>& entry) const { @@ -69,17 +68,16 @@ public: } }; -template<class HashFuncEntry> -const typename HashFuncEntry::HashFuncType& getHashFunc -(HashFuncEntry* first, HashFuncEntry* last, const std::string& hashType) +template <class HashFuncEntry> +const typename HashFuncEntry::HashFuncType& +getHashFunc(HashFuncEntry* first, HashFuncEntry* last, + const std::string& hashType) { - HashFuncEntry* e = - std::find_if(first, last, - FindHashFunc<typename HashFuncEntry::HashFuncType> - (hashType)); - if(e == last) { - throw DL_ABORT_EX - (fmt("Hash type %s is not supported.", hashType.c_str())); + HashFuncEntry* e = std::find_if( + first, last, + FindHashFunc<typename HashFuncEntry::HashFuncType>(hashType)); + if (e == last) { + throw DL_ABORT_EX(fmt("Hash type %s is not supported.", hashType.c_str())); } return e->hashFunc; } |
