From 3b27c9ca281e97211f54683fb7f59165b4847b22 Mon Sep 17 00:00:00 2001
From: Konrad Pabjan <kopabjan@microsoft.com>
Date: Fri, 31 Jul 2020 19:06:56 +0200
Subject: [PATCH] PR feedback

---
 dist/index.js | 8 ++++----
 src/search.ts | 7 +++----
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/dist/index.js b/dist/index.js
index 503c934..a61842e 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -6307,12 +6307,12 @@ function findFilesToUpload(searchPath, globOptions) {
                 core_1.debug(`File:${searchResult} was found using the provided searchPath`);
                 searchResults.push(searchResult);
                 // detect any files that would be overwritten because of case insensitivity
-                const currentSetSize = set.size;
-                set.add(searchResult.toLowerCase());
-                if (currentSetSize === set.size) {
-                    // set size has not changed which means paths can be overwritten
+                if (set.has(searchResult.toLowerCase())) {
                     core_1.info(`Uploads are case insensitive: ${searchResult} was detected that it will be overwritten by another file with the same path`);
                 }
+                else {
+                    set.add(searchResult.toLowerCase());
+                }
             }
             else {
                 core_1.debug(`Removing ${searchResult} from rawSearchResults because it is a directory`);
diff --git a/src/search.ts b/src/search.ts
index adbb61b..bd80164 100644
--- a/src/search.ts
+++ b/src/search.ts
@@ -107,13 +107,12 @@ export async function findFilesToUpload(
       searchResults.push(searchResult)
 
       // detect any files that would be overwritten because of case insensitivity
-      const currentSetSize = set.size
-      set.add(searchResult.toLowerCase())
-      if (currentSetSize === set.size) {
-        // set size has not changed which means paths can be overwritten
+      if (set.has(searchResult.toLowerCase())) {
         info(
           `Uploads are case insensitive: ${searchResult} was detected that it will be overwritten by another file with the same path`
         )
+      } else {
+        set.add(searchResult.toLowerCase())
       }
     } else {
       debug(