diff options
author | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2013-03-03 12:06:43 +0100 |
---|---|---|
committer | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2013-03-03 12:06:43 +0100 |
commit | 6b172ef1b1651e6ccf016b26c9ea94fad6df3152 (patch) | |
tree | a62dffda9143a619531be9f96912938659d3a890 /klm/util/stream/sort.hh | |
parent | 349ee7d5599bb973506c8bbb56926cf9d366b564 (diff) | |
parent | 7deec52e8feb1c908a91224f308e8cbd9a170576 (diff) |
Merge branch 'master' of github.com:pks/cdec-dtrain
Diffstat (limited to 'klm/util/stream/sort.hh')
-rw-r--r-- | klm/util/stream/sort.hh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/klm/util/stream/sort.hh b/klm/util/stream/sort.hh index a86f160f..16aa6a03 100644 --- a/klm/util/stream/sort.hh +++ b/klm/util/stream/sort.hh @@ -365,10 +365,14 @@ template <class Compare> class BlockSorter { // Record the size of each block in a separate file. offsets_->Append(link->ValidSize()); void *end = static_cast<uint8_t*>(link->Get()) + link->ValidSize(); - std::sort( - SizedIt(link->Get(), entry_size), - SizedIt(end, entry_size), - compare_); +#if defined(_WIN32) || defined(_WIN64) + std::stable_sort +#else + std::sort +#endif + (SizedIt(link->Get(), entry_size), + SizedIt(end, entry_size), + compare_); } offsets_->FinishedAppending(); } |