From f4ce548310570d7b7498e58366ff193f22f45607 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 1 May 2019 14:31:21 +0100 Subject: [PATCH] Import: replace size check with isEmpty(). --- .../com/etesync/syncadapter/ui/importlocal/ImportFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/ImportFragment.kt b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/ImportFragment.kt index 73b8bfa2..072d3099 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/ImportFragment.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/ImportFragment.kt @@ -220,7 +220,7 @@ class ImportFragment : DialogFragment() { val events = Event.fromReader(importReader, null) importReader.close() - if (events.size == 0) { + if (events.isEmpty()) { Logger.log.warning("Empty/invalid file.") result.e = Exception("Empty/invalid file.") return result @@ -263,7 +263,7 @@ class ImportFragment : DialogFragment() { val downloader = ContactsSyncManager.ResourceDownloader(context) val contacts = Contact.fromReader(importReader, downloader) - if (contacts.size == 0) { + if (contacts.isEmpty()) { Logger.log.warning("Empty/invalid file.") result.e = Exception("Empty/invalid file.") return result