Kenneth Hsu
cb4972f900
Add test for obtaining unique items with custom comparer.
2017-09-28 21:30:29 -07:00
Kenneth Hsu
705bbe198f
Modify test to use string data.
...
This will allow us to more easily test the case where a custom equality
comparer is provided.
2017-09-28 21:30:29 -07:00
Kenneth Hsu
4b5ecedc31
Allow custom equality comparer when obtaining unique items.
2017-09-28 21:30:29 -07:00
Kenneth Hsu
c658458e01
Add unit test for method to get unique items.
2017-09-28 21:30:29 -07:00
Kenneth Hsu
f2699e01dc
Add method to get unique items from a collection.
...
For cases where we want both the unique items as well as the duplicates,
this should be more performant than using LINQ.
2017-09-28 21:30:29 -07:00
Kenneth Skovhede and GitHub
33314ce7c9
Merge pull request #2763 from tygill/fix/list-ienumerable
...
Change IBackend.List() to return IEnumerable instead of List
2017-09-28 11:06:41 +02:00
Kenneth Skovhede and GitHub
11be1ba73b
Merge pull request #2770 from warwickmm/bugfix/bad_string_format_item
...
Fix incorrect format item in format string
2017-09-28 11:02:54 +02:00
Kenneth Skovhede and GitHub
7af7c4e0a5
Merge pull request #2771 from warwickmm/refactor/avoid_unnecessary_enumeration
...
Avoid unnecessary enumeration
2017-09-28 11:02:33 +02:00
Kenneth Skovhede and GitHub
1f0f73da6f
Merge pull request #2772 from warwickmm/refactor/remove_string_format
...
Remove unnecessary call to String.Format
2017-09-28 11:00:02 +02:00
Kenneth Skovhede and GitHub
3411d46474
Merge pull request #2773 from warwickmm/refactor/convert_if_to_switch
...
Convert if statements to switch statements for enums
2017-09-28 10:59:15 +02:00
Kenneth Skovhede
7ed1362e4c
Merge branch 'master' into concurrent_processing
...
# Conflicts:
# Duplicati/Library/Main/Operation/BackupHandler.cs
2017-09-27 09:58:29 +02:00
Kenneth Skovhede
3ceb1087a7
Merge branch 'master' of github.com:duplicati/duplicati
2017-09-27 09:55:49 +02:00
Kenneth Hsu
4673fe8eee
Convert if statement to switch statement.
...
When the comparison is performed on an enum, using a switch statement
can allow for additional compiler optimizations.
2017-09-26 21:32:58 -07:00
Kenneth Hsu
bd98273067
Convert if statement to switch statement.
...
When the comparison is performed on an enum, using a switch statement
can allow for additional compiler optimizations.
2017-09-26 21:01:33 -07:00
Kenneth Hsu
210ecdf118
Convert if statement to switch statement.
...
When the comparison is performed on an enum, using a switch statement
can allow for additional compiler optimizations.
2017-09-26 21:00:19 -07:00
Kenneth Hsu
0738c5b624
Remove unnecessary call to String.Format.
2017-09-26 20:43:27 -07:00
Kenneth Hsu
79e0f69506
Convert if statement to switch statement.
...
When the comparison is performed on an enum, using a switch statement
can allow for additional compiler optimizations.
2017-09-26 20:20:14 -07:00
Kenneth Hsu
5da12a704d
Convert if statement to switch statement.
...
When the comparison is performed on an enum, using a switch statement
can allow for additional compiler optimizations.
2017-09-26 20:13:40 -07:00
Kenneth Hsu
c082b18389
Declare variable outside of if statement.
...
This will allow us to more easily convert the if statement to a switch
statement.
2017-09-26 20:10:19 -07:00
Kenneth Hsu
4edf8536da
Remove unused argument in string formatting.
2017-09-26 19:56:29 -07:00
Kenneth Hsu
59703e268c
Avoid unnecessary enumeration.
...
Instead of enumerating the entire sequence and checking that the number
of elements is positive, we can simply check to see if the sequence
contains at least one element.
2017-09-26 19:45:07 -07:00
Kenneth Hsu
ce1577fbc2
Fix incorrect format item in format string.
2017-09-26 19:32:08 -07:00
Kenneth Skovhede
37e42b718d
Fix not shutting down backendmanager if it is required for something else.
...
This fixes #2759
2017-09-26 22:45:24 +02:00
Kenneth Skovhede and GitHub
436dd7f017
Merge pull request #2761 from warwickmm/refactor/simplify_duplicate_file_check
...
Use simpler data structures when detecting duplicate filenames
2017-09-26 15:42:46 +02:00
Kenneth Skovhede and GitHub
a3270e4323
Merge pull request #2762 from warwickmm/improve_argument_exceptions
...
Improve construction of ArgumentExceptions
2017-09-26 15:42:07 +02:00
Kenneth Skovhede
9c0c5fbb97
Merge branch 'master' into concurrent_processing
2017-09-26 14:26:09 +02:00
Kenneth Skovhede
66feb4f25a
Merge branch 'feature/fix-zip-methods'
2017-09-26 14:25:23 +02:00
Kenneth Skovhede
a4452d9add
Merge branch 'master' of github.com:duplicati/duplicati
2017-09-26 14:24:35 +02:00
Kenneth Skovhede
51084ada57
Merge branch 'feature/use-faster-hashing'
2017-09-26 14:24:20 +02:00
Kenneth Skovhede
a955daca3f
Changed the reported zip compression methods to reflect what is actually supported by SharpCompress
2017-09-26 14:06:11 +02:00
Kenneth Skovhede
d15c0656cb
Updated FasterHashing
2017-09-26 13:09:21 +02:00
Kenneth Skovhede
640ec634b7
Increased delays in unittest due to faster hashing performance
2017-09-26 09:41:27 +02:00
Tyler Gill
44c53d3eb1
Merge branch 'master' of https://github.com/duplicati/duplicati into fix/list-ienumerable
2017-09-25 23:19:38 -06:00
Tyler Gill
b3a3911d98
Change from wrapping yield returning methods with methods that do a try/catch, since they don't work due to lazy evaluation.
2017-09-25 23:19:31 -06:00
Tyler Gill
38883285ee
Change IBackend.List() to return IEnumerable instead of List
...
By changing to IEnumerable, it is possible to iterate only a portion of the list, which is useful when not all entries are needed (e.g., when testing a connection).
All existing backends have been updated, and any which were able to be changed to yield return results in a straightforward way now do.
Many backends had a try/catch in the List() method. Due to the fact that yield returns can't be placed within a try/catch block, these have been refactored to either scope the try/catch to the parts that (should) be the only places throwing exceptions, so that exceptions are still caught and handled.
Note that lazy evaluation may cause some changes in behavior - exceptions that were previously thrown at the point of invokation of List() may now be thrown while it is being enumerated.
I believe this will not be problematic though, as the only well-known exception seems to be FolderMissingException, which should be thrown by Test(), but TestList() attempts to enumerate the list to force this exception.
Any places that require the legacy behavior can get it by simply converting the lazy enumerable to a List()
2017-09-25 23:17:45 -06:00
Kenneth Hsu
fe9c760ff1
Avoid using parameter name in exception message.
...
The parameter name is provided as a separate argument to
ArgumentException.
2017-09-25 19:56:28 -07:00
Kenneth Hsu
b84e7bd34d
Avoid hard-coded parameter names.
...
This makes it easier to rename the parameter in the future as we don't
have to search for the parameter name within strings.
2017-09-25 19:54:54 -07:00
Kenneth Hsu
e9ffc2cbe1
Add clearer exception message.
2017-09-25 19:54:54 -07:00
Kenneth Hsu
97681a704b
Add clearer exception message.
2017-09-25 19:54:54 -07:00
Kenneth Hsu
4950c72128
Add clearer exception message.
2017-09-25 19:54:54 -07:00
Kenneth Hsu
239e62cb91
Fix argument order for ArgumentException.
2017-09-25 19:40:39 -07:00
Kenneth Skovhede and GitHub
9141ccfd41
Merge pull request #2757 from tygill/feature/quota-info
...
Add IQuotaInfo interface
2017-09-25 23:05:19 +02:00
Kenneth Skovhede
31e8d7eb14
Updated FasterHashing library
2017-09-25 15:39:33 +02:00
Kenneth Skovhede
98e603073a
Fixed orphan curly brace
2017-09-25 14:43:37 +02:00
Kenneth Skovhede
bc88be457e
Added an option to select the pagesize used in B2 list_bucket requests
2017-09-25 11:56:02 +02:00
Tyler Gill
b4f56750f8
Add IQuotaInfo interface
...
It also makes quota enabled backends return an instance of this interface instead of the quota components separately.
This way, getting quota stats requires only a single remote request on backends like Google Drive and OneDrive.
2017-09-24 17:30:52 -06:00
Kenneth Hsu
d2adde730a
Use simpler data structures to detect duplicate filenames.
...
A Dictionary is unnecessary since we don't have any key-value pairs. We
just need to keep track of a unique collection of filenames.
2017-09-24 08:40:14 -07:00
Kenneth Skovhede
0a54fd87d3
Merge branch 'master' into concurrent_processing
...
# Conflicts:
# Duplicati/Library/Main/packages.config
# Duplicati/Library/UsageReporter/Duplicati.Library.UsageReporter.csproj
# Duplicati/Library/UsageReporter/packages.config
2017-09-23 22:04:35 +02:00
Kenneth Skovhede
6c921ab3ec
Merge branch 'master' of github.com:duplicati/duplicati
2017-09-23 22:01:08 +02:00
Kenneth Skovhede and GitHub
60b94b758f
Merge pull request #2754 from warwickmm/refactor/avoid_extension_method
...
Reference property instead of invoking extension method.
2017-09-23 15:06:09 +02:00