Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3179)

Unified Diff: base/time/time.h

Issue 2386723002: Add Explicit Argument Guidance for time.h (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time/time.h
diff --git a/base/time/time.h b/base/time/time.h
index 648445f35a2394ec7bea7a5506a2dbd68ce12a67..fd09effc85dfd61015901b202e33a84120d90d5f 100644
--- a/base/time/time.h
+++ b/base/time/time.h
@@ -25,6 +25,11 @@
// instance. Thus, they can be efficiently passed by-value (as opposed to
danakj 2016/09/30 19:57:47 This is already said here though?
robliao 2016/09/30 20:03:06 Agreed this discusses it, but in a non-opinionated
// by-reference).
//
+// Prefer passing these classes by value:
+// void MyFunction(TimeDelta arg);
+// If circumstances require, you may also pass by const reference:
+// void MyFunction(const TimeDelta& arg); // not preferred
danakj 2016/09/30 19:57:47 nit: // Not preferred.
robliao 2016/09/30 20:03:06 Done.
+//
// Definitions of operator<< are provided to make these types work with
// DCHECK_EQ() and other log macros. For human-readable formatting, see
// "base/i18n/time_formatting.h".
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698