From a310b1d1c2d9b6d79175e474da1b1d880bef2082 Mon Sep 17 00:00:00 2001 From: wangshao1 <30471730+wangshao1@users.noreply.github.com> Date: Thu, 3 Aug 2023 11:30:18 +0800 Subject: [PATCH] fix: fix some compile error (#1861) Co-authored-by: wangshaoyi --- build.sh | 2 +- include/pika_list.h | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index e5fd942bd5..fe1fd33b94 100755 --- a/build.sh +++ b/build.sh @@ -93,7 +93,7 @@ fi cd ${BUILD_DIR} use_pika_tools="" -if [ $1 = "tools" ]; then +if [[ $1 = "tools" ]]; then use_pika_tools="-DUSE_PIKA_TOOLS=ON" fi diff --git a/include/pika_list.h b/include/pika_list.h index b6c1378d00..a98de285cb 100644 --- a/include/pika_list.h +++ b/include/pika_list.h @@ -98,12 +98,12 @@ class BlockingBaseCmd : public Cmd { class BLPopCmd final : public BlockingBaseCmd { public: BLPopCmd(const std::string& name, int arity, uint16_t flag) : BlockingBaseCmd(name, arity, flag){}; - virtual std::vector current_key() const { + virtual std::vector current_key() const override { return { keys_ }; } - virtual void Do(std::shared_ptr slot = nullptr); - virtual void Split(std::shared_ptr slot, const HintKeys& hint_keys){}; - virtual void Merge(){}; + virtual void Do(std::shared_ptr slot = nullptr) override; + virtual void Split(std::shared_ptr slot, const HintKeys& hint_keys) override {}; + virtual void Merge() override {}; virtual Cmd* Clone() override { return new BLPopCmd(*this); } void DoInitial() override; void DoBinlog(const std::shared_ptr& slot) override; @@ -257,12 +257,12 @@ class LTrimCmd : public Cmd { class BRPopCmd final : public BlockingBaseCmd { public: BRPopCmd(const std::string& name, int arity, uint16_t flag) : BlockingBaseCmd(name, arity, flag){}; - virtual std::vector current_key() const { + virtual std::vector current_key() const override { return { keys_ }; } - virtual void Do(std::shared_ptr slot = nullptr); - virtual void Split(std::shared_ptr slot, const HintKeys& hint_keys){}; - virtual void Merge(){}; + virtual void Do(std::shared_ptr slot = nullptr) override; + virtual void Split(std::shared_ptr slot, const HintKeys& hint_keys) override {}; + virtual void Merge() override {}; virtual Cmd* Clone() override { return new BRPopCmd(*this); } void DoInitial() override; void DoBinlog(const std::shared_ptr& slot) override;