`end`用或运营商
我正在读一段代码是这样的:`end`用或运营商
def majority_agreed_commit current_commit = log_container.last_commit
current_term_match_indices = match_indices.values.map do |match_index|
match_index.downto(current_commit).find do |i|
log_container.term(i) == current_term
end || current_commit
end
我不明白这是什么意思:end || current_commit
。有人能帮助我吗?
回答:
块
match_index.downto(current_commit).find do |i| log_container.term(i) == current_term
end
返回一个值,该值与current_commit
逻辑相加,结果被产生在最上面的map
:
match_indices.values.map do |...| BLOCK_RESULT || current_commit
end
以上是 `end`用或运营商 的全部内容, 来源链接: utcz.com/qa/264489.html