[geary/mjog/558-webkit-shared-process: 8/11] Minor perf improvement when conversation load was cancelled.



commit 1a391758fafa243242ecbbcc09475a55e9f911f8
Author: Michael Gratton <mike vee net>
Date:   Tue Nov 26 14:21:50 2019 +1100

    Minor perf improvement when conversation load was cancelled.
    
    Lazily initialise the ConversationMessage's web onlt after checking to
    see if the conversation load as been cancelled or not.

 src/client/conversation-viewer/conversation-message.vala | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-message.vala 
b/src/client/conversation-viewer/conversation-message.vala
index 4e510ad8..da0a57e4 100644
--- a/src/client/conversation-viewer/conversation-message.vala
+++ b/src/client/conversation-viewer/conversation-message.vala
@@ -819,13 +819,14 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
     public async void load_message_body(Geary.RFC822.Message message,
                                         GLib.Cancellable load_cancelled)
         throws GLib.Error {
-        if (this.web_view == null)
-            initialize_web_view();
-
         if (load_cancelled.is_cancelled()) {
             throw new GLib.IOError.CANCELLED("Conversation load cancelled");
         }
 
+        if (this.web_view == null) {
+            initialize_web_view();
+        }
+
         bool contact_load_images = (
             this.primary_contact != null &&
             this.primary_contact.load_remote_resources


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]