remove history items limit

This commit is contained in:
yggverse 2025-01-12 22:42:22 +02:00
parent cd9e786640
commit 846c488480
4 changed files with 7 additions and 14 deletions

View file

@ -39,14 +39,13 @@ impl Request {
/// Get recent requests vector
/// * sorted by `unix_timestamp` DESC
pub fn recent(&self, limit: usize) -> Vec<GString> {
pub fn recent(&self) -> Vec<GString> {
let mut recent: Vec<GString> = Vec::new();
for (request, _) in self
.index
.borrow()
.iter()
.sorted_by(|a, b| Ord::cmp(&b.1.unix_timestamp, &a.1.unix_timestamp))
.take(limit)
{
recent.push(request.clone())
}