Switch to std::copy

master
sigonasr2 1 year ago
parent f8814bec65
commit 6d806e12d0
  1. 10
      SHNFileDecryptor/SHNFileDecryptor.h

@ -145,14 +145,8 @@ void SHNFile::Decrypt(){
} }
std::vector<std::byte>&SHNFile::ReadBytes(int bytes){ std::vector<std::byte>&SHNFile::ReadBytes(int bytes){
readArr.clear(); readArr.clear();
for(int i=0;i<bytes;i++){ std::copy(data.begin()+marker,data.begin()+marker+bytes,std::back_inserter(readArr));
if(marker<data.size()){ marker+=bytes;
readArr.push_back(data[marker]);
marker++;
} else {
break;
}
}
return readArr; return readArr;
} }
std::byte SHNFile::ReadByte(){ std::byte SHNFile::ReadByte(){

Loading…
Cancel
Save