Revision 1cc1e8c5 trunk/Pithos.Core/LocalFileComparer.cs
b/trunk/Pithos.Core/LocalFileComparer.cs | ||
---|---|---|
14 | 14 |
return false; |
15 | 15 |
if (x.CloudFile != null && y.CloudFile != null ) |
16 | 16 |
{ |
17 |
if (x.CloudFile.Hash == null & y.CloudFile.Hash != null)
|
|
17 |
if (x.CloudFile.X_Object_Hash == null & y.CloudFile.X_Object_Hash != null)
|
|
18 | 18 |
return false; |
19 |
if (x.CloudFile.Hash != null & y.CloudFile.Hash == null)
|
|
19 |
if (x.CloudFile.X_Object_Hash != null & y.CloudFile.X_Object_Hash == null)
|
|
20 | 20 |
return false; |
21 |
if (x.CloudFile.Hash == null & y.CloudFile.Hash == null)
|
|
21 |
if (x.CloudFile.X_Object_Hash == null & y.CloudFile.X_Object_Hash == null)
|
|
22 | 22 |
return (x.CloudFile.Name == y.CloudFile.Name); |
23 |
|
|
24 |
if (!x.CloudFile.Hash.Equals(y.CloudFile.Hash))
|
|
23 |
|
|
24 |
if (!x.CloudFile.X_Object_Hash.Equals(y.CloudFile.X_Object_Hash))
|
|
25 | 25 |
return false; |
26 | 26 |
//All directories have the same hash. Compare them using their names instead |
27 | 27 |
if (x.CloudFile.Content_Type == y.CloudFile.Content_Type && x.CloudFile.IsDirectory) |
... | ... | |
45 | 45 |
{ |
46 | 46 |
//All directories have the same hash code. Use their name's hash code instead |
47 | 47 |
hash2 = obj.CloudFile.IsDirectory |
48 |
? obj.CloudFile.Name.GetHashCode()
|
|
49 |
: (obj.CloudFile.Hash ?? obj.CloudFile.Name ?? "").GetHashCode(); |
|
48 |
? obj.CloudFile.Name.GetHashCode() |
|
49 |
: (obj.CloudFile.X_Object_Hash ?? obj.CloudFile.Name ?? "").GetHashCode();
|
|
50 | 50 |
} |
51 | 51 |
var hash3 = obj.Action.GetHashCode(); |
52 | 52 |
return hash1 ^ hash2 & hash3; |
Also available in: Unified diff