[geary/mjog/search-refinement: 12/14] Remove some redundant collection copies
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/mjog/search-refinement: 12/14] Remove some redundant collection copies
- Date: Mon, 16 Dec 2019 23:11:57 +0000 (UTC)
commit 67601498d82690cf4b0e6816bbcfbafb056c756d
Author: Michael Gratton <mike vee net>
Date: Sat Dec 14 18:09:48 2019 +1100
Remove some redundant collection copies
src/engine/imap-engine/imap-engine-minimal-folder.vala | 16 +++++++---------
.../imap-engine/replay-ops/imap-engine-mark-email.vala | 8 +++++---
.../replay-ops/imap-engine-move-email-prepare.vala | 5 +++--
.../imap-engine/replay-ops/imap-engine-remove-email.vala | 5 +++--
4 files changed, 18 insertions(+), 16 deletions(-)
---
diff --git a/src/engine/imap-engine/imap-engine-minimal-folder.vala
b/src/engine/imap-engine/imap-engine-minimal-folder.vala
index 09f9b2ba..923b8e71 100644
--- a/src/engine/imap-engine/imap-engine-minimal-folder.vala
+++ b/src/engine/imap-engine/imap-engine-minimal-folder.vala
@@ -1258,9 +1258,9 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
RemoveEmail remove = new RemoveEmail(
this,
- (Gee.List<ImapDB.EmailIdentifier>)
- traverse(to_expunge).to_array_list(),
- cancellable);
+ (Gee.Collection<ImapDB.EmailIdentifier>) to_expunge,
+ cancellable
+ );
replay_queue.schedule(remove);
yield remove.wait_for_ready_async(cancellable);
@@ -1312,8 +1312,8 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
MarkEmail mark = new MarkEmail(
this,
- (Gee.List<ImapDB.EmailIdentifier>)
- traverse(to_mark).to_array_list(),
+ (Gee.Collection<ImapDB.EmailIdentifier>)
+ to_mark,
flags_to_add,
flags_to_remove,
cancellable
@@ -1374,10 +1374,8 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
return null;
MoveEmailPrepare prepare = new MoveEmailPrepare(
- this,
- (Gee.List<ImapDB.EmailIdentifier>)
- traverse(to_move).to_array_list(),
- cancellable);
+ this, (Gee.Collection<ImapDB.EmailIdentifier>) to_move, cancellable
+ );
replay_queue.schedule(prepare);
yield prepare.wait_for_ready_async(cancellable);
diff --git a/src/engine/imap-engine/replay-ops/imap-engine-mark-email.vala
b/src/engine/imap-engine/replay-ops/imap-engine-mark-email.vala
index ddb0ed91..b48e8edb 100644
--- a/src/engine/imap-engine/replay-ops/imap-engine-mark-email.vala
+++ b/src/engine/imap-engine/replay-ops/imap-engine-mark-email.vala
@@ -12,9 +12,11 @@ private class Geary.ImapEngine.MarkEmail : Geary.ImapEngine.SendReplayOperation
private Gee.Map<ImapDB.EmailIdentifier, Geary.EmailFlags>? original_flags = null;
private Cancellable? cancellable;
- public MarkEmail(MinimalFolder engine, Gee.List<ImapDB.EmailIdentifier> to_mark,
- Geary.EmailFlags? flags_to_add, Geary.EmailFlags? flags_to_remove,
- Cancellable? cancellable = null) {
+ public MarkEmail(MinimalFolder engine,
+ Gee.Collection<ImapDB.EmailIdentifier> to_mark,
+ EmailFlags? flags_to_add,
+ EmailFlags? flags_to_remove,
+ GLib.Cancellable? cancellable = null) {
base("MarkEmail", OnError.RETRY);
this.engine = engine;
diff --git a/src/engine/imap-engine/replay-ops/imap-engine-move-email-prepare.vala
b/src/engine/imap-engine/replay-ops/imap-engine-move-email-prepare.vala
index 498de990..087dc202 100644
--- a/src/engine/imap-engine/replay-ops/imap-engine-move-email-prepare.vala
+++ b/src/engine/imap-engine/replay-ops/imap-engine-move-email-prepare.vala
@@ -19,8 +19,9 @@ private class Geary.ImapEngine.MoveEmailPrepare : Geary.ImapEngine.SendReplayOpe
private Cancellable? cancellable;
private Gee.List<ImapDB.EmailIdentifier> to_move = new Gee.ArrayList<ImapDB.EmailIdentifier>();
- public MoveEmailPrepare(MinimalFolder engine, Gee.Collection<ImapDB.EmailIdentifier> to_move,
- Cancellable? cancellable) {
+ public MoveEmailPrepare(MinimalFolder engine,
+ Gee.Collection<ImapDB.EmailIdentifier> to_move,
+ GLib.Cancellable? cancellable) {
base.only_local("MoveEmailPrepare", OnError.RETRY);
this.engine = engine;
diff --git a/src/engine/imap-engine/replay-ops/imap-engine-remove-email.vala
b/src/engine/imap-engine/replay-ops/imap-engine-remove-email.vala
index 429fb259..de86ab71 100644
--- a/src/engine/imap-engine/replay-ops/imap-engine-remove-email.vala
+++ b/src/engine/imap-engine/replay-ops/imap-engine-remove-email.vala
@@ -11,8 +11,9 @@ private class Geary.ImapEngine.RemoveEmail : Geary.ImapEngine.SendReplayOperatio
private Gee.Set<ImapDB.EmailIdentifier>? removed_ids = null;
private int original_count = 0;
- public RemoveEmail(MinimalFolder engine, Gee.List<ImapDB.EmailIdentifier> to_remove,
- Cancellable? cancellable = null) {
+ public RemoveEmail(MinimalFolder engine,
+ Gee.Collection<ImapDB.EmailIdentifier> to_remove,
+ GLib.Cancellable? cancellable = null) {
base("RemoveEmail", OnError.RETRY);
this.engine = engine;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]