From: tho Date: Fri, 3 Aug 2007 12:19:09 +0000 (+0000) Subject: some beautification: use std::for_each in Parse_SNDUPacket::calcCrc() X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=43f2010f6e4eb9a3c972b98b350f13733e583fc6;p=senf.git some beautification: use std::for_each in Parse_SNDUPacket::calcCrc() git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@376 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Packets/MPEGDVBBundle/SNDUPacket.cc b/Packets/MPEGDVBBundle/SNDUPacket.cc index e55812f..cd2d8d2 100644 --- a/Packets/MPEGDVBBundle/SNDUPacket.cc +++ b/Packets/MPEGDVBBundle/SNDUPacket.cc @@ -52,12 +52,10 @@ prefix_ senf::PacketParserBase::size_type senf::Parse_SNDUPacket::bytes() prefix_ boost::uint32_t senf::Parse_SNDUPacket::calcCrc() const { - ule_crc32 result; - senf::PacketData::iterator i (data().begin()); - senf::PacketData::iterator const i_end(boost::prior(data().end(),4)); - for (; i!=i_end; ++i) - result.process_byte(*i); - return result.checksum(); + return std::for_each( + data().begin(), + boost::prior(data().end(), 4), + ule_crc32() ).checksum(); } prefix_ void senf::SNDUPacketType::dump(packet p, std::ostream & os)