From dee917bcdfcf11a449d29aade0bf032a7446f6fb Mon Sep 17 00:00:00 2001 From: Simon Krueger Date: Tue, 14 Jan 2025 11:14:28 -0800 Subject: [PATCH] Updating Observer doc comment formating for fbcref Summary: fbcref expects code examples to have 4 leading spaces to be identified as pre/code blocks Reviewed By: Gownta Differential Revision: D68038199 fbshipit-source-id: c5111a9a3fc1118d9b340adaf4126341b2f58e4f --- .../folly/src/folly/observer/Observer.h | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/third-party/folly/src/folly/observer/Observer.h b/third-party/folly/src/folly/observer/Observer.h index 5570ad0960d89..83f78586dee22 100644 --- a/third-party/folly/src/folly/observer/Observer.h +++ b/third-party/folly/src/folly/observer/Observer.h @@ -35,10 +35,12 @@ namespace observer { * Given an Observer, you can get a snapshot of the current version of the * object it holds: * - * Observer myObserver = ...; - * Snapshot mySnapshot = myObserver.getSnapshot(); + * Observer myObserver = ...; + * Snapshot mySnapshot = myObserver.getSnapshot(); + * * or simply - * Snapshot mySnapshot = *myObserver; + * + * Snapshot mySnapshot = *myObserver; * * Snapshot will hold a view of the object, even if object in the Observer * gets updated. @@ -48,20 +50,20 @@ namespace observer { * Observers. Imagine we have two separate Observers A and B which hold * integers. * - * Observer observerA = ...; - * Observer observerB = ...; + * Observer observerA = ...; + * Observer observerB = ...; * * To compute a sum of A and B we can create a new Observer which would track * updates to A and B and re-compute the sum only when necessary. * - * Observer sumObserver = makeObserver( - * [observerA, observerB] { - * int a = **observerA; - * int b = **observerB; - * return a + b; - * }); + * Observer sumObserver = makeObserver( + * [observerA, observerB] { + * int a = **observerA; + * int b = **observerB; + * return a + b; + * }); * - * int sum = **sumObserver; + * int sum = **sumObserver; * * Notice that a + b will be only called when either a or b is changed. Getting * a snapshot from sumObserver won't trigger any re-computation.