Skip to content

Commit

Permalink
1.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
liborty committed Jun 11, 2024
1 parent 6a3c8df commit 9a56d3c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "indxvec"
version = "1.9.3"
version = "1.9.4"
authors = ["Libor Spacek"]
edition = "2021"
description = "Vecs sorting, merging, indexing, ranking, searching, reversing, intersecting, printing, etc."
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,7 @@ use indxvec::{MinMax,here};

## Release Notes (Latest First)

**Version 1.9.3** Made `ranked` faster.

**Version 1.9.2** Added `ranked` to trait Indices. Given rank index, it selects data values from `v` of sufficient rank, keeping their order.
**Version 1.9.4** Added `ranked` to trait Indices. Given rank index, it selects data values from `v` of sufficient rank, keeping their order.

**Version 1.9.1** Stopped Trait Printing consuming single items by implementing it for `&T` rather than `T`.

Expand Down
6 changes: 4 additions & 2 deletions src/indices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ impl Indices for &[usize] {
let mut res = Vec::with_capacity(rank);
let mut count = 0_usize; // count the produced items for early exit
for (&r,item) in self.iter().zip(v) {
if r < rank { count += 1; res.push(item.clone());
if count > rank { break }; };
if r < rank {
res.push(item.clone());
count += 1;
if count == rank { break }; };
};
res
}
Expand Down

0 comments on commit 9a56d3c

Please sign in to comment.