mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-27 04:42:35 +00:00
v0.1.4
This commit is contained in:
@@ -196,11 +196,12 @@ impl BitArray {
|
||||
* Clears all bits (sets to false).
|
||||
*/
|
||||
pub fn clear(&mut self) {
|
||||
let max = self.bits.len();
|
||||
for i in 0..max {
|
||||
//for (int i = 0; i < max; i++) {
|
||||
self.bits[i] = 0;
|
||||
}
|
||||
// let max = self.bits.len();
|
||||
// for i in 0..max {
|
||||
// //for (int i = 0; i < max; i++) {
|
||||
// self.bits[i] = 0;
|
||||
// }
|
||||
self.bits.fill(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -212,6 +212,10 @@ impl BitMatrix {
|
||||
return Ok(((self.bits[offset] >> (x & 0x1f)) & 1) != 0);
|
||||
}
|
||||
|
||||
pub fn check_in_bounds(&self, x: u32, y: u32) -> bool {
|
||||
(y as usize * self.row_size + (x as usize / 32)) > self.bits.len()
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Sets the given bit to true.</p>
|
||||
*
|
||||
@@ -281,11 +285,12 @@ impl BitMatrix {
|
||||
* Clears all bits (sets to false).
|
||||
*/
|
||||
pub fn clear(&mut self) {
|
||||
let max = self.bits.len();
|
||||
for i in 0..max {
|
||||
//for (int i = 0; i < max; i++) {
|
||||
self.bits[i] = 0;
|
||||
}
|
||||
// let max = self.bits.len();
|
||||
// for i in 0..max {
|
||||
// //for (int i = 0; i < max; i++) {
|
||||
// self.bits[i] = 0;
|
||||
// }
|
||||
self.bits.fill(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user