Rename timer `Setup` function to `Schedule`
This patch was motivated by my desire to fix a typo in the function
name. The noun "setup" is 1 word. The verb "set up" is 2 words. All
other member functions are verbs, so this one should be a verb too.
That means that the function should be called `SetUp`. During the
discussion that resulted from the rename, James Kuszmaul pointed out
that "setting up" a timer can be confusing. It implies that you can
only "set up" a timer once. But the intent is to let users set up
timers as many times as they like. So we decided on renaming the
function to `Schedule`. That conveys the purpose and intent better.
I took this opportunity to fix some other typos involving the verb
"set up".
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I2f557d1f946960af82711f248820d5e2d385a5d3
diff --git a/aos/network/web_proxy.cc b/aos/network/web_proxy.cc
index d7ab418..7f52611 100644
--- a/aos/network/web_proxy.cc
+++ b/aos/network/web_proxy.cc
@@ -65,7 +65,8 @@
});
event_loop_->OnRun([this, timer]() {
- timer->Setup(event_loop_->monotonic_now(), std::chrono::milliseconds(100));
+ timer->Schedule(event_loop_->monotonic_now(),
+ std::chrono::milliseconds(100));
});
}
@@ -189,7 +190,8 @@
});
event_loop->OnRun([timer, event_loop]() {
- timer->Setup(event_loop->monotonic_now(), std::chrono::milliseconds(10));
+ timer->Schedule(event_loop->monotonic_now(),
+ std::chrono::milliseconds(10));
});
}
}
@@ -237,7 +239,7 @@
fbb.Finish(message_offset);
// Now, the flatbuffer is built from the back to the front. So any
- // extra memory will be at the front. Setup the end and start
+ // extra memory will be at the front. Set up the end and start
// pointers on the mbuf.
mbuf_set_end(mbuffer, packet_size);
mbuf_set_pos(mbuffer, packet_size - fbb.GetSize());