ruby-changes:6787
From: nobu <ko1@a...>
Date: Fri, 1 Aug 2008 14:55:09 +0900 (JST)
Subject: [ruby-changes:6787] Ruby:r18303 (trunk, ruby_1_8): * win32/win32.c (rb_w32_seekdir): no need to rewind to seek forward.
nobu 2008-08-01 14:54:45 +0900 (Fri, 01 Aug 2008) New Revision: 18303 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18303 Log: * win32/win32.c (rb_w32_seekdir): no need to rewind to seek forward. Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/win32/win32.c trunk/ChangeLog trunk/win32/win32.c Index: ChangeLog =================================================================== --- ChangeLog (revision 18302) +++ ChangeLog (revision 18303) @@ -1,3 +1,7 @@ +Fri Aug 1 14:54:42 2008 Nobuyoshi Nakada <nobu@r...> + + * win32/win32.c (rb_w32_seekdir): no need to rewind to seek forward. + Fri Aug 1 05:31:08 2008 NARUSE, Yui <naruse@r...> * transcode.c (output_replacement_character): Index: win32/win32.c =================================================================== --- win32/win32.c (revision 18302) +++ win32/win32.c (revision 18303) @@ -1628,7 +1628,7 @@ void rb_w32_seekdir(DIR *dirp, off_t loc) { - rb_w32_rewinddir(dirp); + if (dirp->loc > loc) rb_w32_rewinddir(dirp); while (dirp->curr && dirp->loc < loc) { move_to_next_entry(dirp); Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 18302) +++ ruby_1_8/ChangeLog (revision 18303) @@ -1,5 +1,7 @@ -Fri Aug 1 14:45:56 2008 Nobuyoshi Nakada <nobu@r...> +Fri Aug 1 14:54:42 2008 Nobuyoshi Nakada <nobu@r...> + * win32/win32.c (rb_w32_seekdir): no need to rewind to seek forward. + * win32/win32.c (rb_w32_telldir): just returns loc. * win32/win32.c (rb_w32_rewinddir): needs to intialize loc. Index: ruby_1_8/win32/win32.c =================================================================== --- ruby_1_8/win32/win32.c (revision 18302) +++ ruby_1_8/win32/win32.c (revision 18303) @@ -1645,9 +1645,9 @@ void rb_w32_seekdir(DIR *dirp, long loc) { - rb_w32_rewinddir(dirp); + if (dirp->loc > loc) rb_w32_rewinddir(dirp); - while (dirp->curr && loc-- > 0) { + while (dirp->curr && dirp->loc < loc) { move_to_next_entry(dirp); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/