From eae5c08e76e6af939965b8fcb11c9365c579b2be Mon Sep 17 00:00:00 2001 From: Ryan Russell Date: Tue, 31 May 2022 15:07:00 -0500 Subject: [PATCH] Improve Comment Readability (#69) Signed-off-by: Ryan Russell --- src/core/dash.h | 4 ++-- src/core/dash_internal.h | 2 +- src/core/expire_period.h | 2 +- src/core/external_alloc.h | 2 +- src/core/interpreter.h | 2 +- src/core/small_string.h | 2 +- src/server/db_slice.h | 2 +- src/server/set_family.cc | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/dash.h b/src/core/dash.h index c55f2a3..e779e24 100644 --- a/src/core/dash.h +++ b/src/core/dash.h @@ -12,7 +12,7 @@ namespace dfly { // DASH: Dynamic And Scalable Hashing. // TODO: We could name it DACHE: Dynamic and Adaptive caCHE. -// After all, we added additionaly improvements we added as part of the dragonfly project, +// After all, we added additionally improvements we added as part of the dragonfly project, // that probably justify a right to choose our own name for this data structure. struct BasicDashPolicy { enum { kSlotNum = 12, kBucketNum = 64, kStashBucketNum = 2 }; @@ -225,7 +225,7 @@ class DashTable : public detail::DashTableBase { // In practice traversal is limited to a single segment. The operation is read-only and // simulates insertion process. 'cb' must accept bucket_iterator. // Note: the interface a bit hacky. - // The functions call cb on physical buckets with version smalller than ver_threshold that + // The functions call cb on physical buckets with version smaller than ver_threshold that // due to entry movements might update its version to version greater than ver_threshold. // // These are not const functions because they send non-const iterators that allow diff --git a/src/core/dash_internal.h b/src/core/dash_internal.h index 88e30e0..0896237 100644 --- a/src/core/dash_internal.h +++ b/src/core/dash_internal.h @@ -555,7 +555,7 @@ template int TryInsertToBucket(unsigned bidx, U&& key, V&& value, uint8_t meta_hash, bool probe) { auto& b = bucket_[bidx]; diff --git a/src/core/expire_period.h b/src/core/expire_period.h index 023b568..ac31d69 100644 --- a/src/core/expire_period.h +++ b/src/core/expire_period.h @@ -20,7 +20,7 @@ class ExpirePeriod { Set(ms); } - // alwaws returns milliseconds value. + // always returns milliseconds value. uint64_t duration_ms() const { return precision_ ? uint64_t(val_) * 1000 : val_; } diff --git a/src/core/external_alloc.h b/src/core/external_alloc.h index 18be353..412a140 100644 --- a/src/core/external_alloc.h +++ b/src/core/external_alloc.h @@ -28,7 +28,7 @@ constexpr inline unsigned long long operator""_KB(unsigned long long x) { * as a state machine that either returns an offset to the backign storage or the indication * of the resource that is missing. The advantage of such design is that we can use it in * asynchronous callbacks without blocking on any IO requests. - * The allocator uses dynanic memory internally. Should be used in a single thread. + * The allocator uses dynamic memory internally. Should be used in a single thread. * */ diff --git a/src/core/interpreter.h b/src/core/interpreter.h index f2de300..5376ffc 100644 --- a/src/core/interpreter.h +++ b/src/core/interpreter.h @@ -93,7 +93,7 @@ class Interpreter { // We have interpreter per thread, not per connection. // Since we might preempt into different fibers when operating on interpreter // we must lock it until we finish using it per request. - // Only RunFunction with companions require locking since other functions peform atomically + // Only RunFunction with companions require locking since other functions perform atomically // without preemptions. std::lock_guard<::boost::fibers::mutex> Lock() { return std::lock_guard<::boost::fibers::mutex>{mu_}; diff --git a/src/core/small_string.h b/src/core/small_string.h index 6d9efc3..9ac3517 100644 --- a/src/core/small_string.h +++ b/src/core/small_string.h @@ -10,7 +10,7 @@ namespace dfly { // blob strings of upto ~64KB. Small sizes are probably predominant -// for in-mmeory workloads, especially for keys. +// for in-memory workloads, especially for keys. // Please note that this class does not have automatic constructors and destructors, therefore // it requires explicit management. class SmallString { diff --git a/src/server/db_slice.h b/src/server/db_slice.h index 068ffab..2f893c3 100644 --- a/src/server/db_slice.h +++ b/src/server/db_slice.h @@ -86,7 +86,7 @@ class DbSlice { Stats GetStats() const; //! UpdateExpireClock updates the expire clock for this db slice. - //! Must be a wall clock so we could replicate it betweeen machines. + //! Must be a wall clock so we could replicate it between machines. void UpdateExpireClock(uint64_t now_ms) { now_ms_ = now_ms; } diff --git a/src/server/set_family.cc b/src/server/set_family.cc index 60b2e0e..86bf494 100644 --- a/src/server/set_family.cc +++ b/src/server/set_family.cc @@ -435,7 +435,7 @@ OpStatus Mover::OpFind(Transaction* t, EngineShard* es) { for (auto k : largs) { unsigned index = (k == src_) ? 0 : 1; OpResult res = es->db_slice().Find(t->db_index(), k, OBJ_SET); - if (res && index == 0) { // succesful src find. + if (res && index == 0) { // successful src find. DCHECK(!res->is_done()); const CompactObj& val = res.value()->second; SetType st{val.RObjPtr(), val.Encoding()};