rename helper methods

This commit is contained in:
Vukašin Stepanović
2023-02-15 12:52:59 +00:00
parent bfcdb397ad
commit 935519ced5
133 changed files with 858 additions and 1044 deletions

View File

@@ -168,7 +168,7 @@ impl BitArray {
pub fn setRange(&mut self, start: usize, end: usize) -> Result<(), Exceptions> {
let mut end = end;
if end < start || end > self.size {
return Err(Exceptions::illegalArgumentEmpty());
return Err(Exceptions::illegalArgument);
}
if end == start {
return Ok(());
@@ -211,7 +211,7 @@ impl BitArray {
pub fn isRange(&self, start: usize, end: usize, value: bool) -> Result<bool, Exceptions> {
let mut end = end;
if end < start || end > self.size {
return Err(Exceptions::illegalArgumentEmpty());
return Err(Exceptions::illegalArgument);
}
if end == start {
return Ok(true); // empty range matches
@@ -253,7 +253,7 @@ impl BitArray {
*/
pub fn appendBits(&mut self, value: u32, num_bits: usize) -> Result<(), Exceptions> {
if num_bits > 32 {
return Err(Exceptions::illegalArgument(
return Err(Exceptions::illegalArgumentWith(
"num bits must be between 0 and 32",
));
}
@@ -286,7 +286,7 @@ impl BitArray {
pub fn xor(&mut self, other: &BitArray) -> Result<(), Exceptions> {
if self.size != other.size {
return Err(Exceptions::illegalArgument("Sizes don't match"));
return Err(Exceptions::illegalArgumentWith("Sizes don't match"));
}
for i in 0..self.bits.len() {
//for (int i = 0; i < bits.length; i++) {