Skip to content

Commit

Permalink
Do not use ranged for in windows code.
Browse files Browse the repository at this point in the history
It's not supported in VS2010, and VS2010 is still being used widely.
  • Loading branch information
zcbenz committed Jan 2, 2014
1 parent fa7c925 commit a8acbaa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/win/pty.cc
Expand Up @@ -60,7 +60,8 @@ const wchar_t* to_wstring(const String::Utf8Value& str)
}

static winpty_t *get_pipe_handle(int handle) {
for(winpty_t *ptyHandle : ptyHandles) {
for(size_t i = 0; i < ptyHandles.size(); ++i) {
winpty_t *ptyHandle = ptyHandles[i];
int current = (int)ptyHandle->controlPipe;
if(current == handle) {
return ptyHandle;
Expand All @@ -70,7 +71,8 @@ static winpty_t *get_pipe_handle(int handle) {
}

static bool remove_pipe_handle(int handle) {
for(winpty_t *ptyHandle : ptyHandles) {
for(size_t i = 0; i < ptyHandles.size(); ++i) {
winpty_t *ptyHandle = ptyHandles[i];
if((int)ptyHandle->controlPipe == handle) {
delete ptyHandle;
ptyHandle = nullptr;
Expand Down

0 comments on commit a8acbaa

Please sign in to comment.