Skip to content

Commit

Permalink
make constants constant to encourage inlining
Browse files Browse the repository at this point in the history
  • Loading branch information
sjneph committed Jul 17, 2017
1 parent f82564d commit 7611fe1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions interfaces/general-headers/data/bed/Bed.hpp
Expand Up @@ -664,10 +664,10 @@ namespace Bed {
*id_ = '\0';
*fullrest_ = '\0';
restOffset_ = -1;
int numScanned = std::sscanf(inputLine.c_str(),
format, chrom_,
&start_, &end_, id_,
&measurement_, other);
const int numScanned = std::sscanf(inputLine.c_str(),
format, chrom_,
&start_, &end_, id_,
&measurement_, other);

const int numWritten = std::snprintf(fullrest_, MAXRESTSIZE+1, (std::string("\t%s\t") + BaseClass::MFormat).c_str(), id_, measurement_);
if ( other[0] != '\0' && numWritten < MAXRESTSIZE ) {
Expand All @@ -685,10 +685,10 @@ namespace Bed {
*id_ = '\0';
*fullrest_ = '\0';
restOffset_ = -1;
int numScanned = std::fscanf(inputFile,
format, chrom_,
&start_, &end_, id_,
&measurement_, other);
const int numScanned = std::fscanf(inputFile,
format, chrom_,
&start_, &end_, id_,
&measurement_, other);

std::fgetc(inputFile); // Read and discard trailing newline

Expand Down

0 comments on commit 7611fe1

Please sign in to comment.