[PATCH] D23653: Minor cleanup of SimpleTypoCorrector

Alexander Shaposhnikov via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 19 16:40:56 PDT 2016


alexshap added a reviewer: Eugene.Zelenko.
alexshap removed rL LLVM as the repository for this revision.
alexshap updated this revision to Diff 68746.
alexshap added a comment.

1. clang-tidy -checks=google-explicit-constructor tools/clang/lib/AST/CommentSema.cpp - no other issues found
2. clang-format -i -lines 960:967 tools/clang/lib/AST/CommentSema.cpp - done


https://reviews.llvm.org/D23653

Files:
  lib/AST/CommentSema.cpp

Index: lib/AST/CommentSema.cpp
===================================================================
--- lib/AST/CommentSema.cpp
+++ lib/AST/CommentSema.cpp
@@ -950,20 +950,17 @@
 
 namespace {
 class SimpleTypoCorrector {
+  const NamedDecl *BestDecl;
   StringRef Typo;
   const unsigned MaxEditDistance;
-
-  const NamedDecl *BestDecl;
   unsigned BestEditDistance;
   unsigned BestIndex;
   unsigned NextIndex;
 
 public:
-  SimpleTypoCorrector(StringRef Typo) :
-      Typo(Typo), MaxEditDistance((Typo.size() + 2) / 3),
-      BestDecl(nullptr), BestEditDistance(MaxEditDistance + 1),
-      BestIndex(0), NextIndex(0)
-  { }
+  explicit SimpleTypoCorrector(StringRef Typo)
+      : BestDecl(nullptr), Typo(Typo), MaxEditDistance((Typo.size() + 2) / 3),
+        BestEditDistance(MaxEditDistance + 1), BestIndex(0), NextIndex(0) {}
 
   void addDecl(const NamedDecl *ND);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23653.68746.patch
Type: text/x-patch
Size: 878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160819/9aca4bc2/attachment.bin>


More information about the cfe-commits mailing list