Skip to content

Commit

Permalink
Clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
kstppd committed Sep 24, 2024
1 parent 6772ad8 commit 18af465
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/npy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ inline npy_data<Scalar> read_npy(std::istream &in) {
}

template <typename Scalar>
inline void read_npy_into(std::istream &in,npy_data<Scalar>& data) {
inline void read_npy_into(std::istream &in, npy_data<Scalar> &data) {
std::string header_s = read_header(in);

// parse header
Expand All @@ -523,8 +523,8 @@ inline void read_npy_into(std::istream &in,npy_data<Scalar>& data) {
data.shape = header.shape;
data.fortran_order = header.fortran_order;

//This will now do nothing
if (data.data.size()!=size){
// This will now do nothing
if (data.data.size() != size) {
data.data.resize(size);
}

Expand All @@ -544,12 +544,12 @@ inline npy_data<Scalar> read_npy(const std::string &filename) {
}

template <typename Scalar>
inline void read_npy_into(const std::string &filename,npy_data<Scalar>& data) {
inline void read_npy_into(const std::string &filename, npy_data<Scalar> &data) {
std::ifstream stream(filename, std::ifstream::binary);
if (!stream) {
throw std::runtime_error("io error: failed to open a file.");
}
read_npy_into<Scalar>(stream,data);
read_npy_into<Scalar>(stream, data);
return;
}

Expand Down

0 comments on commit 18af465

Please sign in to comment.