Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactorings, code improvements and bug fixes #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DevDrake
Copy link

-Resharper Code Cleanup
-Removed redundant code
-Fixed issues in stream structure description(comment)
-Removed usage of ArrayList in favor of List - yes it was used xD
-Sorted some of the properties/methods in files
-Improved readibility
-Cleanup of usages
-Fixed few bugs on the way
-Improved execution time slighty
-"Fixed" equals to do the same as other equal - yet it seems wrong.
#Massive changes in general, get it for free or leave it. Leaving it as a token of gratitude.
It still works as before.

-Resharper Code Cleanup
-Removed redundant code
-Fixed issues in stream structure description(comment)
-Removed usage of ArrayList in favor of List<T> - yes it was used xD
-Sorted some of the properties/methods in files
-Improved readibility
-Cleanup of usages
-Fixed few bugs on the way
-Improved execution time slighty
-"Fixed" equals to do the same as other equal - yet it seems wrong.
#Massive changes in general, get it for free or leave it. I do hope it will help you.
It still works as before.
@ironfede
Copy link
Owner

Massive thanks @DevDrake , it will take some time to check all your work before merging, but meanwhile please let me kindly know what you have identified as "bug" (>>Fixed few bugs on the way) because I should give high priority to those changes that fixes functional errors.
Thank You!
Best Regards,
Federico

/// </example>
public abstract class CFItem : IComparable<CFItem>
public abstract class CFItem : IComparable<CFItem>, IEquatable<CFItem>
Copy link
Author

Choose a reason for hiding this comment

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

Added The IEquatable interface to complete the IComparable

}

// If one is null, but not both, return false.
if (((object)leftItem == null) || ((object)rightItem == null))
Copy link
Author

Choose a reason for hiding this comment

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

Fixed this, the comment sugest different behavior than written. Implemented the intended XOR

/// Checks the underlying stream without throwing exception.
/// </summary>
/// <returns>true if stream is closed, false if stream is open.</returns>
protected bool IsDisposed()
Copy link
Author

@DevDrake DevDrake Dec 18, 2018

Choose a reason for hiding this comment

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

Added the no throwing version of checking Disposed status for Try_ functions


#region IComparable Members

public int CompareTo(CFItem other)
Copy link
Author

Choose a reason for hiding this comment

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

Fixed the implementation of IComparable for the class

get { return miniSectorShift; }
}
// 34 | 6 | Not used
// 40 | 4 | Total number of sectors used Directory (➜5.2)
Copy link
Author

Choose a reason for hiding this comment

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

fixed incorrect byte

internal int CompareTo(CFItem other)
{

return this.dirEntry.CompareTo(other.DirEntry);
Copy link
Author

@DevDrake DevDrake Dec 18, 2018

Choose a reason for hiding this comment

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

In General, this seems to be incorrect as we omit the second property CompoundFile - but i am not sure if the current implementation relies on that in any way, therefore i left it hanging like that.

/// </example>
public bool TryGetStorage(String storageName, CFStorage cfStorage)
public bool TryGetStorage(string storageName, out CFStorage cfStorage)
Copy link
Author

Choose a reason for hiding this comment

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

Fixed the API to actually return the value

@DevDrake
Copy link
Author

Hi @ironfede, first, thanks for sharing the OpenMCDF with the community!
Sorry for making all the changes in the single commit - I just didn't expect myself to contribute, yet i sow value so there it is.
i have put the things i fixed in comments in the diff, there are some TODO added in the code, and some things that have been forgotten already. Again sorry, i wasn't tracking it until i found it will add the value to the projects.
The formatting of the code has changed significantly, if you have specific guidelines i can modify the commit get them in the account, otherwise you got the JetBrains default guidelines for c# in this commit.
Merry Xmas,
Mikolaj

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.

None yet

2 participants