mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
fix limit condition
This commit is contained in:
parent
9db4049169
commit
64f1867aa3
1 changed files with 3 additions and 3 deletions
|
|
@ -57,7 +57,7 @@ impl Memory {
|
|||
})
|
||||
.enumerate()
|
||||
{
|
||||
if limit.is_some_and(|l| i > l) {
|
||||
if limit.is_some_and(|l| i >= l) {
|
||||
break;
|
||||
}
|
||||
recent.push(item.clone())
|
||||
|
|
@ -74,7 +74,7 @@ impl Memory {
|
|||
.sorted_by(|a, b| Ord::cmp(&b.opened.time, &a.opened.time))
|
||||
.enumerate()
|
||||
{
|
||||
if limit.is_some_and(|l| i > l) {
|
||||
if limit.is_some_and(|l| i >= l) {
|
||||
break;
|
||||
}
|
||||
recent.push(item.clone())
|
||||
|
|
@ -87,7 +87,7 @@ impl Memory {
|
|||
pub fn contains_request(&self, request: &str, limit: Option<usize>) -> Vec<Item> {
|
||||
let mut items: Vec<Item> = Vec::new();
|
||||
for (i, item) in self.0.iter().enumerate() {
|
||||
if limit.is_some_and(|l| i > l) {
|
||||
if limit.is_some_and(|l| i >= l) {
|
||||
break;
|
||||
}
|
||||
let p = request.to_lowercase();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue