summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2016-03-21 16:19:18 +0100
committerbunnei <bunneidev@gmail.com>2016-03-21 16:19:18 +0100
commit446d7c7e55a6ab00af606d0c712e00d4b792f9f7 (patch)
tree31ae3e0b490cfa6da389bdb9e28997bac6baf46e /src/core
parentMerge pull request #1562 from lioncash/constexpr (diff)
parentsoc_u: Get rid of explicit delete and new (diff)
downloadyuzu-446d7c7e55a6ab00af606d0c712e00d4b792f9f7.tar
yuzu-446d7c7e55a6ab00af606d0c712e00d4b792f9f7.tar.gz
yuzu-446d7c7e55a6ab00af606d0c712e00d4b792f9f7.tar.bz2
yuzu-446d7c7e55a6ab00af606d0c712e00d4b792f9f7.tar.lz
yuzu-446d7c7e55a6ab00af606d0c712e00d4b792f9f7.tar.xz
yuzu-446d7c7e55a6ab00af606d0c712e00d4b792f9f7.tar.zst
yuzu-446d7c7e55a6ab00af606d0c712e00d4b792f9f7.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/soc_u.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp
index b52e52d4a..ff0af8f12 100644
--- a/src/core/hle/service/soc_u.cpp
+++ b/src/core/hle/service/soc_u.cpp
@@ -5,6 +5,7 @@
#include <algorithm>
#include <cstring>
#include <unordered_map>
+#include <vector>
#include "common/assert.h"
#include "common/bit_field.h"
@@ -593,17 +594,13 @@ static void Poll(Service::Interface* self) {
// The 3ds_pollfd and the pollfd structures may be different (Windows/Linux have different sizes)
// so we have to copy the data
- pollfd* platform_pollfd = new pollfd[nfds];
- for (unsigned current_fds = 0; current_fds < nfds; ++current_fds)
- platform_pollfd[current_fds] = CTRPollFD::ToPlatform(input_fds[current_fds]);
+ std::vector<pollfd> platform_pollfd(nfds);
+ std::transform(input_fds, input_fds + nfds, platform_pollfd.begin(), CTRPollFD::ToPlatform);
- int ret = ::poll(platform_pollfd, nfds, timeout);
+ const int ret = ::poll(platform_pollfd.data(), nfds, timeout);
// Now update the output pollfd structure
- for (unsigned current_fds = 0; current_fds < nfds; ++current_fds)
- output_fds[current_fds] = CTRPollFD::FromPlatform(platform_pollfd[current_fds]);
-
- delete[] platform_pollfd;
+ std::transform(platform_pollfd.begin(), platform_pollfd.end(), output_fds, CTRPollFD::FromPlatform);
int result = 0;
if (ret == SOCKET_ERROR_VALUE)