bmap

Check-in Differences
Login

Check-in Differences

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Difference From bmap-0.2.1 To bmap-0.2.2

2024-09-02
16:37
Merge. Leaf check-in: a3dd710d2a user: jan tags: trunk
2024-03-21
13:42
Happy clippy. check-in: 88d12c5ae1 user: jan tags: bmap-0.2.2, trunk
13:39
Release maintenance. check-in: 1bfe47f3a8 user: jan tags: trunk
13:35
Add unsafe set_unchecked(). check-in: d8806abadd user: jan tags: trunk
10:39
Release maintenance. check-in: d43e21d672 user: jan tags: bmap-0.2.1, trunk
10:37
Implement Debug for CountedBitmap. check-in: 39fed45718 user: jan tags: trunk

Changes to Cargo.toml.

1
2
3
4
5
6
7
8
9
10
[package]
name = "bmap"
version = "0.2.1"
edition = "2021"
license = "0BSD"
# https://crates.io/category_slugs
categories = [ "data-structures" ]
keywords = [ "bitmap", "bitvec" ]
repository = "https://repos.qrnch.tech/pub/bmap"
description = "A bitmap with an internal counter."


|







1
2
3
4
5
6
7
8
9
10
[package]
name = "bmap"
version = "0.2.2"
edition = "2021"
license = "0BSD"
# https://crates.io/category_slugs
categories = [ "data-structures" ]
keywords = [ "bitmap", "bitvec" ]
repository = "https://repos.qrnch.tech/pub/bmap"
description = "A bitmap with an internal counter."

Changes to src/lib.rs.

178
179
180
181
182
183
184























185
186
187
188
189
190
191
    let v = unsafe { self.bits.get_unchecked_mut(iword) };
    if *v & bitval == 0 {
      *v |= bitval;
      self.remain -= 1;
    }
    Ok(())
  }
























  /// Clear a bit.
  ///
  /// ```
  /// use bmap::CountedBitmap;
  ///
  /// let mut bmap = CountedBitmap::new(4);







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
    let v = unsafe { self.bits.get_unchecked_mut(iword) };
    if *v & bitval == 0 {
      *v |= bitval;
      self.remain -= 1;
    }
    Ok(())
  }

  /// Set a bit, where it is assumed that the caller has validated that the
  /// `idx` parameter is valid.
  ///
  /// ```
  /// use bmap::CountedBitmap;
  ///
  /// let mut bmap = CountedBitmap::new(4);
  /// unsafe { bmap.set_unchecked(2) };
  /// assert_eq!(bmap.is_set(2).unwrap(), true);
  /// ```
  ///
  /// # Safety
  /// The caller must ensure that `idx` is within bounds.
  #[inline]
  pub unsafe fn set_unchecked(&mut self, idx: usize) {
    let (iword, bitval) = self.get_bidx_unchecked(idx);
    let v = self.bits.get_unchecked_mut(iword);
    if *v & bitval == 0 {
      *v |= bitval;
      self.remain -= 1;
    }
  }

  /// Clear a bit.
  ///
  /// ```
  /// use bmap::CountedBitmap;
  ///
  /// let mut bmap = CountedBitmap::new(4);

Changes to www/changelog.md.

1
2
3
4
5
6
7
8
9
10
11
12
13
14










15
16
17
18
19
20
21
# Change Log

⚠️  indicates a breaking change.

## [Unreleased]

[Details](/vdiff?from=bmap-0.2.1&to=trunk)

### Added

### Changed

### Removed











---

## [0.2.1] - 2024-03-21

[Details](/vdiff?from=bmap-0.2.0&to=bmap-0.2.1)

### Changed






|







>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Change Log

⚠️  indicates a breaking change.

## [Unreleased]

[Details](/vdiff?from=bmap-0.2.2&to=trunk)

### Added

### Changed

### Removed

---

## [0.2.2] - 2024-03-21

[Details](/vdiff?from=bmap-0.2.1&to=bmap-0.2.2)

### Added

- Added `unsafe` `CountedBitmap::set_unchecked()`.

---

## [0.2.1] - 2024-03-21

[Details](/vdiff?from=bmap-0.2.0&to=bmap-0.2.1)

### Changed