From bc6af598cfc62d68cc4a80c0aa10d8573d63cfc0 Mon Sep 17 00:00:00 2001 From: Tomek Mrugalski Date: Wed, 8 May 2013 11:22:40 +0200 Subject: [PATCH] [2898] pair replaced with make_pair --- src/bin/dhcp6/tests/dhcp6_srv_unittest.cc | 2 +- src/lib/dhcp/tests/libdhcp++_unittest.cc | 10 +++++----- src/lib/dhcp/tests/pkt6_unittest.cc | 18 +++++++++--------- src/lib/dhcpsrv/cfgmgr.cc | 6 ++---- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc index 53b1daf47d..8184adfa1e 100644 --- a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc +++ b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc @@ -1699,7 +1699,7 @@ TEST_F(Dhcpv6SrvTest, selectSubnetRelayInterfaceId) { relay.linkaddr_ = IOAddress("2001:db8:2::1234"); relay.peeraddr_ = IOAddress("fe80::1"); OptionPtr opt = generateInterfaceId("relay2"); - relay.options_.insert(pair(opt->getType(), opt)); + relay.options_.insert(make_pair(opt->getType(), opt)); pkt->relay_info_.push_back(relay); // There is only one subnet configured and we are outside of that subnet diff --git a/src/lib/dhcp/tests/libdhcp++_unittest.cc b/src/lib/dhcp/tests/libdhcp++_unittest.cc index dbab49290d..1567829edb 100644 --- a/src/lib/dhcp/tests/libdhcp++_unittest.cc +++ b/src/lib/dhcp/tests/libdhcp++_unittest.cc @@ -265,11 +265,11 @@ TEST_F(LibDhcpTest, packOptions6) { OptionPtr opt4(new Option(Option::V6, 6, buf.begin() + 8, buf.begin() + 12)); OptionPtr opt5(new Option(Option::V6, 8, buf.begin() + 12, buf.begin() + 14)); - opts.insert(pair(opt1->getType(), opt1)); - opts.insert(pair(opt1->getType(), opt2)); - opts.insert(pair(opt1->getType(), opt3)); - opts.insert(pair(opt1->getType(), opt4)); - opts.insert(pair(opt1->getType(), opt5)); + opts.insert(make_pair(opt1->getType(), opt1)); + opts.insert(make_pair(opt1->getType(), opt2)); + opts.insert(make_pair(opt1->getType(), opt3)); + opts.insert(make_pair(opt1->getType(), opt4)); + opts.insert(make_pair(opt1->getType(), opt5)); OutputBuffer assembled(512); diff --git a/src/lib/dhcp/tests/pkt6_unittest.cc b/src/lib/dhcp/tests/pkt6_unittest.cc index a7a366dc10..b713d2bb98 100644 --- a/src/lib/dhcp/tests/pkt6_unittest.cc +++ b/src/lib/dhcp/tests/pkt6_unittest.cc @@ -507,7 +507,7 @@ TEST_F(Pkt6Test, relayPack) { OptionPtr optRelay1(new Option(Option::V6, 200, relay_data)); - relay1.options_.insert(pair >(optRelay1->getType(), optRelay1)); + relay1.options_.insert(make_pair(optRelay1->getType(), optRelay1)); OptionPtr opt1(new Option(Option::V6, 100)); OptionPtr opt2(new Option(Option::V6, 101)); @@ -581,9 +581,9 @@ TEST_F(Pkt6Test, getAnyRelayOption) { OptionPtr relay1_opt2(generateRandomOption(201)); OptionPtr relay1_opt3(generateRandomOption(202)); - relay1.options_.insert(pair >(200, relay1_opt1)); - relay1.options_.insert(pair >(201, relay1_opt2)); - relay1.options_.insert(pair >(202, relay1_opt3)); + relay1.options_.insert(make_pair(200, relay1_opt1)); + relay1.options_.insert(make_pair(201, relay1_opt2)); + relay1.options_.insert(make_pair(202, relay1_opt3)); msg->addRelayInfo(relay1); // generate options for relay2 @@ -592,16 +592,16 @@ TEST_F(Pkt6Test, getAnyRelayOption) { OptionPtr relay2_opt2(new Option(Option::V6, 101)); OptionPtr relay2_opt3(new Option(Option::V6, 102)); OptionPtr relay2_opt4(new Option(Option::V6, 200)); // the same code as relay1_opt3 - relay2.options_.insert(pair >(100, relay2_opt1)); - relay2.options_.insert(pair >(101, relay2_opt2)); - relay2.options_.insert(pair >(102, relay2_opt3)); - relay2.options_.insert(pair >(200, relay2_opt4)); + relay2.options_.insert(make_pair(100, relay2_opt1)); + relay2.options_.insert(make_pair(101, relay2_opt2)); + relay2.options_.insert(make_pair(102, relay2_opt3)); + relay2.options_.insert(make_pair(200, relay2_opt4)); msg->addRelayInfo(relay2); // generate options for relay3 Pkt6::RelayInfo relay3; OptionPtr relay3_opt1(generateRandomOption(200, 7)); - relay3.options_.insert(pair >(200, relay3_opt1)); + relay3.options_.insert(make_pair(200, relay3_opt1)); msg->addRelayInfo(relay3); // Ok, so we now have a packet that traversed the following network: diff --git a/src/lib/dhcpsrv/cfgmgr.cc b/src/lib/dhcpsrv/cfgmgr.cc index f1181ddcb9..592efb7942 100644 --- a/src/lib/dhcpsrv/cfgmgr.cc +++ b/src/lib/dhcpsrv/cfgmgr.cc @@ -40,8 +40,7 @@ CfgMgr::addOptionSpace4(const OptionSpacePtr& space) { isc_throw(InvalidOptionSpace, "option space " << space->getName() << " already added."); } - spaces4_.insert(std::pair(space->getName(), space)); + spaces4_.insert(make_pair(space->getName(), space)); } void @@ -55,8 +54,7 @@ CfgMgr::addOptionSpace6(const OptionSpacePtr& space) { isc_throw(InvalidOptionSpace, "option space " << space->getName() << " already added."); } - spaces6_.insert(std::pair(space->getName(), space)); + spaces6_.insert(make_pair(space->getName(), space)); } void