On 12/28/2012 06:49 PM, julien2412 wrote:
By reading the function MigrationImpl::subtract in
desktop/source/migration/migration.cxx, see
http://opengrok.libreoffice.org/xref/core/desktop/source/migration/migration.cxx#847
I thought about this patch to use "set_difference"
desktop_patch.txt
<http://nabble.documentfoundation.org/file/n4026318/desktop_patch.txt>
The original code is broken to begin with, as it ignores the return 
values from the std::unique calls, so excess elements remain at the end 
of va and vb.
However, the patch is also broken:
* Why "vb.end()+5"?
* The output range of std::set_difference must not overlap with either 
input range.
* The return value of std::set_difference must be observed, to cut off 
excess elements at the end of the returned range.
* If va contains m identical elements and vb contains n < m elements 
identical to them, m - n of those elements will remain in the output of 
std::set_difference, so avoiding std::unique is unsound here.
Stephan
Context
- Re: [PATCH] Simplify MigrationImpl::subtract in desktop · Stephan Bergmann
 
   
 
  Privacy Policy |
  
Impressum (Legal Info) |
  
Copyright information: Unless otherwise specified, all text and images
  on this website are licensed under the
  
Creative Commons Attribution-Share Alike 3.0 License.
  This does not include the source code of LibreOffice, which is
  licensed under the Mozilla Public License (
MPLv2).
  "LibreOffice" and "The Document Foundation" are
  registered trademarks of their corresponding registered owners or are
  in actual use as trademarks in one or more countries. Their respective
  logos and icons are also subject to international copyright laws. Use
  thereof is explained in our 
trademark policy.