Directory listing gets into subdirs twice?

With Kodi 17.1 on Win10, I enter an SMB directory which is the root of a share with 1,541 directories in it. Listing the root of SMB sources has been slow on earlier version of Kodi too but I thought I would go in an look at the logs after setting samba.statfiles to false (which is not looked at on Windows). Here is what i found.

Code:
20:56:39.054 T:4100   DEBUG: CGUIMediaWindow::GetDirectory (smb://JANA/Movies/)
20:56:39.054 T:4100   DEBUG:   ParentPath = [smb://JANA/Movies/]
20:56:39.297 T:4100   DEBUG: XFILE::CWin32SMBDirectory::ConnectAndAuthenticate: Connected to "\\JANA\Movies" with username "HTPC" and with password
20:57:00.651 T:11672   DEBUG: Previous line repeats 1538 times.
20:57:00.651 T:11672   DEBUG: Thread JobWorker 11672 terminating (autodelete)
20:57:00.651 T:4088   DEBUG: Thread JobWorker 4088 terminating (autodelete)
20:57:00.651 T:10648   DEBUG: Thread JobWorker 10648 terminating (autodelete)
20:57:00.663 T:4100   DEBUG: XFILE::CWin32SMBDirectory::ConnectAndAuthenticate: Connected to "\\JANA\Movies" with username "HTPC" and with password
20:57:00.755 T:12708   DEBUG: Previous line repeats 6 times.
20:57:00.755 T:12708   DEBUG: Thread JobWorker 12708 terminating (autodelete)
20:57:00.760 T:4100   DEBUG: XFILE::CWin32SMBDirectory::ConnectAndAuthenticate: Connected to "\\JANA\Movies" with username "HTPC" and with password
20:57:22.785 T:4100   DEBUG: Previous line repeats 1535 times.

It looks like it looked through 3,082 items. Subsequent tests all sum up to 3,082 as well.

Since 3,082 is 1,541 x 2, it appears …

  1. connecting to the share root didn’t call CWin32SMBDirectory::ConnectAndAuthenticate, and
  2. Kodi connects and goes through each directory on the share twice.

What troubles me is that to show the names of the directories Kodi shouldn’t got through those directories at all which it is doing twice.
CWin32SMBDirectory::ConnectAndAuthenticate is called by RealExists so perhaps Kodi is checking the existence of each item (why?) and perhaps doing that twice?

On a smaller scale, if I go into any of those directories that have subdirectories (say 7), the log show 2 x count lines (14).

Am I missing the logic somewhere or is something wrong here?