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

[TechDebt]--Cleanup superfluous IO functions #1478

Merged
merged 7 commits into from
Sep 15, 2021

Conversation

jturner65
Copy link
Contributor

Motivation and Context

This small PR removes some file-based functions from Habitat that replicate functionality provided by Corrade. It further edits existing ones to use Corrade utilities instead of re-inventing the wheel.

How Has This Been Tested

Local C++ and python tests pass

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Sep 15, 2021
Copy link
Collaborator

@mosra mosra left a comment

Choose a reason for hiding this comment

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

image

Nice 🔥 I guess I should finally get to adding glob() to Utility::Directory so you can remove even the last remaining function? :)

@@ -760,7 +759,7 @@ void PTexMeshData::parsePLY(const std::string& filename,
Cr::Containers::Array<const char, Cr::Utility::Directory::MapDeleter>
mmappedData = Cr::Utility::Directory::mapRead(filename);

const size_t fileSize = io::fileSize(filename);
const auto fileSize = *Cr::Utility::Directory::fileSize(filename);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could have stayed as size_t, I think?

(Argh, why I don't have it 64-bit always? 😱)

Copy link
Contributor

@aclegg3 aclegg3 left a comment

Choose a reason for hiding this comment

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

LGTM

@jturner65 jturner65 merged commit ae9d2f5 into facebookresearch:master Sep 15, 2021
@jturner65 jturner65 deleted the Refactor_Cleanup branch September 15, 2021 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants