Skip to content

Commit

Permalink
[Chore] rename func (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
IHEII authored Apr 28, 2024
1 parent b488251 commit 235451b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
11 changes: 5 additions & 6 deletions src/rpc/protocol/lsop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl ObTableSingleOpFlag {

pub fn new() -> Self {
let mut flag = ObTableSingleOpFlag { flags: 0 };
flag.set_flag_is_check_not_exist(false);
flag.set_flag_check_not_exist(false);
flag
}

Expand All @@ -104,8 +104,8 @@ impl ObTableSingleOpFlag {
self.flags = flags;
}

pub fn set_flag_is_check_not_exist(&mut self, is_check_not_exist: bool) {
if is_check_not_exist {
pub fn set_flag_check_not_exist(&mut self, check_not_exist: bool) {
if check_not_exist {
self.flags |= Self::FLAG_IS_CHECK_NOT_EXISTS;
} else {
self.flags &= !Self::FLAG_IS_CHECK_NOT_EXISTS;
Expand Down Expand Up @@ -710,9 +710,8 @@ impl ObTableSingleOp {
self.query = Some(query)
}

pub fn set_is_check_not_exists(&mut self, is_check_not_exists: bool) {
self.op_flag
.set_flag_is_check_not_exist(is_check_not_exists)
pub fn set_check_not_exists(&mut self, check_not_exists: bool) {
self.op_flag.set_flag_check_not_exist(check_not_exists)
}

pub fn is_check_not_exist(&self) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/protocol/payloads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ impl ObTableBatchOperation {

// generate single op
let mut single_op = ObTableSingleOp::new(ObTableOperationType::CheckAndInsertUp);
single_op.set_is_check_not_exists(!option.check_exists);
single_op.set_check_not_exists(!option.check_exists);
single_op.set_query(query);
single_op.add_entity(entity);

Expand Down
9 changes: 4 additions & 5 deletions src/rpc/protocol/query_and_mutate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ impl ObTableQueryAndMutateFlag {
}
}

pub fn set_is_check_not_exists(&mut self, is_check_not_exists: bool) {
if is_check_not_exists {
pub fn set_check_not_exists(&mut self, check_not_exists: bool) {
if check_not_exists {
self.flags |= Self::FLAG_IS_CHECK_NOT_EXISTS;
} else {
self.flags &= !Self::FLAG_IS_CHECK_NOT_EXISTS;
Expand Down Expand Up @@ -130,9 +130,8 @@ impl ObTableQueryAndMutate {
self.option_flag.is_check_and_execute()
}

pub fn set_is_check_not_exists(&mut self, is_check_not_exists: bool) {
self.option_flag
.set_is_check_not_exists(is_check_not_exists)
pub fn set_check_not_exists(&mut self, check_not_exists: bool) {
self.option_flag.set_check_not_exists(check_not_exists)
}

pub fn is_check_not_exists(&self) -> bool {
Expand Down

0 comments on commit 235451b

Please sign in to comment.