diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-09-26 18:41:45 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-09-26 18:41:45 (GMT) |
commit | 4d6cd5c12a10bbe87cc271f99e6d58eaae2ddeec (patch) | |
tree | 9c2007529143478ff34ef6155445fc396acb4f14 | |
parent | 24789b785b21f19c99d9c214ba1b0f5ece8fd09f (diff) | |
download | swift-contrib-4d6cd5c12a10bbe87cc271f99e6d58eaae2ddeec.zip swift-contrib-4d6cd5c12a10bbe87cc271f99e6d58eaae2ddeec.tar.bz2 |
Avoid the use of at().
-rw-r--r-- | Swiften/FileTransfer/IncomingJingleFileTransfer.cpp | 4 | ||||
-rw-r--r-- | Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp b/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp index 1189830..0481a47 100644 --- a/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp +++ b/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp @@ -243,11 +243,11 @@ void IncomingJingleFileTransfer::handleSessionInfoReceived(JinglePayload::ref ji SWIFT_LOG(debug) << "Recevied hash information." << std::endl; if (transferHash->getHashes().find("sha-1") != transferHash->getHashes().end()) { algo = "sha-1"; - hash = transferHash->getHashes().at("sha-1"); + hash = transferHash->getHashes().find("sha-1")->second; } else if (transferHash->getHashes().find("md5") != transferHash->getHashes().end()) { algo = "md5"; - hash = transferHash->getHashes().at("md5"); + hash = transferHash->getHashes().find("md5")->second; } checkIfAllDataReceived(); } diff --git a/Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp index d03ba8b..f1f25cd 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp @@ -410,7 +410,7 @@ class JingleParserTest : public CppUnit::TestFixture { JingleFileTransferHash::ref hash = jingle->getPayload<JingleFileTransferHash>(); CPPUNIT_ASSERT(hash); - CPPUNIT_ASSERT_EQUAL(std::string("552da749930852c69ae5d2141d3766b1"), hash->getHashes().at("sha-1")); + CPPUNIT_ASSERT_EQUAL(std::string("552da749930852c69ae5d2141d3766b1"), hash->getHashes().find("sha-1")->second); } |