Commit 4474c86b authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Assorted nits

Summary: [Folly] Assorted nits.

Reviewed By: chadaustin

Differential Revision: D17677721

fbshipit-source-id: a5903a61059cd60e093423d087b9e1d7e9e5d443
parent e984df45
...@@ -37,7 +37,6 @@ namespace folly { ...@@ -37,7 +37,6 @@ namespace folly {
*/ */
template <typename T> template <typename T>
class CachelinePadded { class CachelinePadded {
public: public:
template <typename... Args> template <typename... Args>
explicit CachelinePadded(Args&&... args) explicit CachelinePadded(Args&&... args)
......
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
* the function accepts a non-const one. * the function accepts a non-const one.
* *
* How does the const behaviour compare to `std::function`? * How does the const behaviour compare to `std::function`?
* `std::function` can wrap object with non-const invokation behaviour but * `std::function` can wrap object with non-const invocation behaviour but
* exposes them as const. The equivalent behaviour can be achieved with * exposes them as const. The equivalent behaviour can be achieved with
* `folly::Function` like so: * `folly::Function` like so:
* *
...@@ -200,15 +200,15 @@ ...@@ -200,15 +200,15 @@
* `std::function` always involves this potentially dangerous aspect, which * `std::function` always involves this potentially dangerous aspect, which
* is why it is not considered fully const-safe or even const-correct. * is why it is not considered fully const-safe or even const-correct.
* However, in most of the cases you will not need the dangerous aspect at all. * However, in most of the cases you will not need the dangerous aspect at all.
* Either you do not require invokation of the function from a const context, * Either you do not require invocation of the function from a const context,
* in which case you do not need to use `constCastFunction` and just * in which case you do not need to use `constCastFunction` and just
* use the inner `folly::Function` in the example above, i.e. just use a * use the inner `folly::Function` in the example above, i.e. just use a
* non-const `folly::Function`. Or, you may need invokation from const, but * non-const `folly::Function`. Or, you may need invocation from const, but
* the callable you are wrapping does not mutate its state (e.g. it is a class * the callable you are wrapping does not mutate its state (e.g. it is a class
* object and implements `operator() const`, or it is a normal, * object and implements `operator() const`, or it is a normal,
* non-mutable lambda), in which case you can wrap the callable in a const * non-mutable lambda), in which case you can wrap the callable in a const
* `folly::Function` directly, without using `constCastFunction`. * `folly::Function` directly, without using `constCastFunction`.
* Only if you require invokation from a const context of a callable that * Only if you require invocation from a const context of a callable that
* may mutate itself when invoked you have to go through the above procedure. * may mutate itself when invoked you have to go through the above procedure.
* However, in that case what you do is potentially dangerous and requires * However, in that case what you do is potentially dangerous and requires
* the equivalent of a `const_cast`, hence you need to call * the equivalent of a `const_cast`, hence you need to call
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
// SharedMutexReadPriority gives priority to readers, // SharedMutexReadPriority gives priority to readers,
// SharedMutexWritePriority gives priority to writers. SharedMutex is an // SharedMutexWritePriority gives priority to writers. SharedMutex is an
// alias for SharedMutexWritePriority, because writer starvation is more // alias for SharedMutexWritePriority, because writer starvation is more
// likely than reader starvation for the read-heavy workloads targetted // likely than reader starvation for the read-heavy workloads targeted
// by SharedMutex. // by SharedMutex.
// //
// In my tests SharedMutex is as good or better than the other // In my tests SharedMutex is as good or better than the other
......
...@@ -193,7 +193,7 @@ class EvictingCacheMap { ...@@ -193,7 +193,7 @@ class EvictingCacheMap {
* bad, e.g., the nIndexBuckets_ is still 100 after maxSize is updated to 1M. * bad, e.g., the nIndexBuckets_ is still 100 after maxSize is updated to 1M.
* *
* Calling this function with an arugment of 0 removes the limit on the cache * Calling this function with an arugment of 0 removes the limit on the cache
* size and elements are not evicted unless clients explictly call prune. * size and elements are not evicted unless clients explicitly call prune.
* *
* If you intend to resize dynamically using this, then picking an index size * If you intend to resize dynamically using this, then picking an index size
* that works well and initializing with corresponding maxSize is the only * that works well and initializing with corresponding maxSize is the only
......
...@@ -205,7 +205,7 @@ class LtHash { ...@@ -205,7 +205,7 @@ class LtHash {
bool operator!=(const LtHash<B, N>& that) const; bool operator!=(const LtHash<B, N>& that) const;
/** /**
* Sets the intial checksum value to use for processing objects in the * Sets the initial checksum value to use for processing objects in the
* xxxObject() calls. * xxxObject() calls.
*/ */
void setChecksum(const folly::IOBuf& checksum); void setChecksum(const folly::IOBuf& checksum);
......
...@@ -1325,7 +1325,7 @@ class AsyncSocket : virtual public AsyncTransportWrapper { ...@@ -1325,7 +1325,7 @@ class AsyncSocket : virtual public AsyncTransportWrapper {
bool trackEor_{false}; bool trackEor_{false};
bool zeroCopyEnabled_{false}; bool zeroCopyEnabled_{false};
bool zeroCopyVal_{false}; bool zeroCopyVal_{false};
// zerocopy reenable logic // zerocopy re-enable logic
size_t zeroCopyReenableThreshold_{0}; size_t zeroCopyReenableThreshold_{0};
size_t zeroCopyReenableCounter_{0}; size_t zeroCopyReenableCounter_{0};
......
...@@ -22,4 +22,4 @@ template <class Duration> ...@@ -22,4 +22,4 @@ template <class Duration>
class HHWheelTimerBase; class HHWheelTimerBase;
using HHWheelTimer = HHWheelTimerBase<std::chrono::milliseconds>; using HHWheelTimer = HHWheelTimerBase<std::chrono::milliseconds>;
using HHWheelTimerHighRes = HHWheelTimerBase<std::chrono::microseconds>; using HHWheelTimerHighRes = HHWheelTimerBase<std::chrono::microseconds>;
} } // namespace folly
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <folly/io/async/Request.h> #include <folly/io/async/Request.h>
#include <folly/lang/Bits.h> #include <folly/lang/Bits.h>
namespace folly { namespace folly {
/** /**
* We want to select the default interval carefully. * We want to select the default interval carefully.
......
...@@ -285,10 +285,10 @@ TEST_F(AsyncSSLSocketWriteTest, write_with_eor1) { ...@@ -285,10 +285,10 @@ TEST_F(AsyncSSLSocketWriteTest, write_with_eor1) {
EXPECT_TRUE(sock_->isEorTrackingEnabled()); EXPECT_TRUE(sock_->isEorTrackingEnabled());
EXPECT_CALL(*(sock_.get()), getRawBytesWritten()) EXPECT_CALL(*(sock_.get()), getRawBytesWritten())
// rawBytesWritten after writting initAppBytesWritten + 1500 // rawBytesWritten after writing initAppBytesWritten + 1500
// + some random SSL overhead // + some random SSL overhead
.WillOnce(Return(3600u)) .WillOnce(Return(3600u))
// rawBytesWritten after writting last 6 bytes // rawBytesWritten after writing last 6 bytes
// + some random SSL overhead // + some random SSL overhead
.WillOnce(Return(3728u)); .WillOnce(Return(3728u));
EXPECT_CALL(*(sock_.get()), sslWriteImpl(_, _, 1500)) EXPECT_CALL(*(sock_.get()), sslWriteImpl(_, _, 1500))
...@@ -329,10 +329,10 @@ TEST_F(AsyncSSLSocketWriteTest, write_with_eor2) { ...@@ -329,10 +329,10 @@ TEST_F(AsyncSSLSocketWriteTest, write_with_eor2) {
sock_->setEorTracking(true); sock_->setEorTracking(true);
EXPECT_CALL(*(sock_.get()), getRawBytesWritten()) EXPECT_CALL(*(sock_.get()), getRawBytesWritten())
// rawBytesWritten after writting initAppBytesWritten + 1500 bytes // rawBytesWritten after writing initAppBytesWritten + 1500 bytes
// + some random SSL overhead // + some random SSL overhead
.WillOnce(Return(3600)) .WillOnce(Return(3600))
// rawBytesWritten after writting last 300 bytes // rawBytesWritten after writing last 300 bytes
// + some random SSL overhead // + some random SSL overhead
.WillOnce(Return(4100)); .WillOnce(Return(4100));
EXPECT_CALL(*(sock_.get()), sslWriteImpl(_, _, 1500)) EXPECT_CALL(*(sock_.get()), sslWriteImpl(_, _, 1500))
......
...@@ -680,7 +680,7 @@ TEST(Conv, IntToDouble) { ...@@ -680,7 +680,7 @@ TEST(Conv, IntToDouble) {
(void)to<float>(957837589847); (void)to<float>(957837589847);
ADD_FAILURE(); ADD_FAILURE();
} catch (std::range_error& e) { } catch (std::range_error& e) {
//LOG(INFO) << e.what(); // LOG(INFO) << e.what();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment