Skip to content

Conversation

atremel
Copy link

@atremel atremel commented Feb 20, 2019

Moving from a to b where a=b will caouse system.io.exception => job fails

Moving from a to b where a=b will caouse system.io.exception => job fails
@@ -175,7 +175,8 @@ public override void UpdateItem(EntryUpdateInfo updateInfo, SyncEntryChangedFlag
else if (updateInfo.Entry.Type == SyncEntryType.Directory)
{
Pre.Assert(!string.IsNullOrEmpty(newFullPath), "newFullPath != null");
Directory.Move(fullPath, newFullPath);
if (fullPath != newFullPath)
Directory.Move(fullPath, newFullPath);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add curly braces here? (common coding style)

@@ -175,7 +175,8 @@ public override void UpdateItem(EntryUpdateInfo updateInfo, SyncEntryChangedFlag
else if (updateInfo.Entry.Type == SyncEntryType.Directory)
{
Pre.Assert(!string.IsNullOrEmpty(newFullPath), "newFullPath != null");
Directory.Move(fullPath, newFullPath);
if (fullPath != newFullPath)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be better written as string.equals.

Suggested change
if (fullPath != newFullPath)
if (!string.Equals(fullPath, newFullPath))

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that would be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants