在下面的代码中,我想在外部for
循环中执行if
条件几次,但在下面的程序中,它只执行一次并执行之后的步骤。binaryHashResult
是array
,innerNode
是List
。我想检查array
中的所有values
是否都存在于list
中。
for (int j = 0; j < binaryHashResult.length; j++)
if (innerNode[binaryHashResult[j]] == 1.0)
for (int h = 0; h < m.children.size(); h++) {
BloomFilterIndex.BFINode<Integer> s=m.children.get(h);
searchencryptedNode(binaryHashResult, e, k, s);
}
始终使用{}包装代码块,无论该块是否只有一行。
for (int j = 0; j < binaryHashResult.length; j++)
if (innerNode[binaryHashResult[j]] == 1.0) {
for (int h = 0; h < m.children.size(); h++) {
BloomFilterIndex.BFINode<Integer> s=m.children.get(h);
searchencryptedNode(binaryHashResult, e, k, s);
} // closes inner for loop
} // closes if
} // closes outer for loop