Clarify the MakeUnique documentation (comment only change, no bug)
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 19 Dec 2014 17:51:10 -0500
changeset 246544 b1f73c9ed680752b6b8c9330150bf6dc289cd505
parent 246543 b6db7735f698a0265bc27d8db94a864e5c451a7b
child 246545 2e09c000bb8babb3f39170152f37594b1fcd1ecf
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Clarify the MakeUnique documentation (comment only change, no bug) DONTBUILD, CLOSED TREE
mfbt/UniquePtr.h
--- a/mfbt/UniquePtr.h
+++ b/mfbt/UniquePtr.h
@@ -629,19 +629,19 @@ struct UniqueSelector<T[N]>
  *
  * First, MakeUnique eliminates use of |new| from code entirely.  If objects are
  * only created through UniquePtr, then (assuming all explicit release() calls
  * are safe, including transitively, and no type-safety casting funniness)
  * correctly maintained ownership of the UniquePtr guarantees no leaks are
  * possible.  (This pays off best if a class is only ever created through a
  * factory method on the class, using a private constructor.)
  *
- * Second, initializing a UniquePtr using a |new| expression requires renaming
- * the new'd type, whereas MakeUnique in concert with the |auto| keyword names
- * it only once:
+ * Second, initializing a UniquePtr using a |new| expression requires repeating
+ * the name of the new'd type, whereas MakeUnique in concert with the |auto|
+ * keyword names it only once:
  *
  *   UniquePtr<char> ptr1(new char()); // repetitive
  *   auto ptr2 = MakeUnique<char>();   // shorter
  *
  * Of course this assumes the reader understands the operation MakeUnique
  * performs.  In the long run this is probably a reasonable assumption.  In the
  * short run you'll have to use your judgment about what readers can be expected
  * to know, or to quickly look up.