From fa510f2dab8f63b3dfaab39b1c94ec74d63b2547 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 24 Dec 2010 22:48:19 +0000 Subject: [PATCH] Turns out that UUID generation is expensive. deferring it until first access improves startup performance. --- src/com/fsck/k9/SearchAccount.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/fsck/k9/SearchAccount.java b/src/com/fsck/k9/SearchAccount.java index 231017db5..ccc368b05 100644 --- a/src/com/fsck/k9/SearchAccount.java +++ b/src/com/fsck/k9/SearchAccount.java @@ -18,7 +18,7 @@ public class SearchAccount implements BaseAccount, SearchSpecification, Serializ private String description = null; private String query = ""; private boolean integrate = false; - private String mUuid = UUID.randomUUID().toString(); + private String mUuid = null; private boolean builtin = false; private String[] accountUuids = null; private String[] folderNames = null; @@ -93,6 +93,10 @@ public class SearchAccount implements BaseAccount, SearchSpecification, Serializ } public String getUuid() { + if(mUuid == null ) + { + setUuid( UUID.randomUUID().toString()); + } return mUuid; } public void setUuid(String nUuid)