X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/321102577020b194dfb7ba89e48687952816849e..039807fd1fb02afb72365fe19a6ad620d1bbf4c7:/examples/cpp/app-bittorrent/s4u-peer.cpp?ds=sidebyside diff --git a/examples/cpp/app-bittorrent/s4u-peer.cpp b/examples/cpp/app-bittorrent/s4u-peer.cpp index bcbde2c05c..43f7f46a74 100644 --- a/examples/cpp/app-bittorrent/s4u-peer.cpp +++ b/examples/cpp/app-bittorrent/s4u-peer.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2022. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -43,14 +43,14 @@ constexpr unsigned message_size(MessageType type) /* REQUEST */ 17, /* PIECE */ 13, /* CANCEL */ 17}}; - return sizes[static_cast(type)]; + return sizes.at(static_cast(type)); } constexpr const char* message_name(MessageType type) { constexpr std::array names{{"HANDSHAKE", "CHOKE", "UNCHOKE", "INTERESTED", "NOTINTERESTED", "HAVE", "BITFIELD", "REQUEST", "PIECE", "CANCEL"}}; - return names[static_cast(type)]; + return names.at(static_cast(type)); } Peer::Peer(std::vector args)