[llvm-commits] [llvm] r164278 - /llvm/trunk/docs/CodingStandards.rst
Andrew Trick
atrick at apple.com
Wed Sep 19 19:01:06 PDT 2012
Author: atrick
Date: Wed Sep 19 21:01:06 2012
New Revision: 164278
URL: http://llvm.org/viewvc/llvm-project?rev=164278&view=rev
Log:
Fix static function names in CodingStandards examples.
Try not to violate conventions immediately before explaining them.
Modified:
llvm/trunk/docs/CodingStandards.rst
Modified: llvm/trunk/docs/CodingStandards.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CodingStandards.rst?rev=164278&r1=164277&r2=164278&view=diff
==============================================================================
--- llvm/trunk/docs/CodingStandards.rst (original)
+++ llvm/trunk/docs/CodingStandards.rst Wed Sep 19 21:01:06 2012
@@ -601,9 +601,9 @@
.. code-block:: c++
- /// ListContainsFoo - Return true if the specified list has an element that is
+ /// containsFoo - Return true if the specified list has an element that is
/// a foo.
- static bool ListContainsFoo(const std::vector<Bar*> &List) {
+ static bool containsFoo(const std::vector<Bar*> &List) {
for (unsigned i = 0, e = List.size(); i != e; ++i)
if (List[i]->isFoo())
return true;
@@ -611,7 +611,7 @@
}
...
- if (ListContainsFoo(BarList)) {
+ if (containsFoo(BarList)) {
...
}
@@ -1120,7 +1120,7 @@
};
} // end anonymous namespace
- static void Helper() {
+ static void runHelper() {
...
}
@@ -1140,7 +1140,7 @@
bool operator<(const char *RHS) const;
};
- void Helper() {
+ void runHelper() {
...
}
@@ -1150,7 +1150,7 @@
} // end anonymous namespace
-This is bad specifically because if you're looking at "``Helper``" in the middle
+This is bad specifically because if you're looking at "``runHelper``" in the middle
of a large C++ file, that you have no immediate way to tell if it is local to
the file. When it is marked static explicitly, this is immediately obvious.
Also, there is no reason to enclose the definition of "``operator<``" in the
More information about the llvm-commits
mailing list