Skip to content

Commit

Permalink
Clean up code in BitAbstractArchiveCreator
Browse files Browse the repository at this point in the history
  • Loading branch information
rikyoz committed Oct 16, 2023
1 parent 03a269d commit eb58cf1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bitabstractarchivecreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void BitAbstractArchiveCreator::setPassword( const tstring& password ) {
auto is_ascii( const tstring& str ) -> bool {
return std::all_of( str.begin(), str.end(), []( tchar character ) -> bool {
// Note: 7-zip supports the DEL character (code 127), while bit7z doesn't.
constexpr auto kFirstAsciiChar = 32; // A
constexpr auto kFirstAsciiChar = 32; // Space character
constexpr auto kLastAsciiChar = 127;
return character >= kFirstAsciiChar && character < kLastAsciiChar;
} );
Expand All @@ -199,7 +199,7 @@ void BitAbstractArchiveCreator::setPassword( const tstring& password, bool crypt
}
#endif
BitAbstractArchiveHandler::setPassword( password );
mCryptHeaders = ( password.length() > 0 ) && cryptHeaders;
mCryptHeaders = !password.empty() && cryptHeaders;
}

void BitAbstractArchiveCreator::setCompressionLevel( BitCompressionLevel level ) noexcept {
Expand Down

0 comments on commit eb58cf1

Please sign in to comment.