<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 19 March 2013 13:28, David Faure <span dir="ltr"><<a href="mailto:faure@kde.org" target="_blank">faure@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div id=":1us">The other would be to write code that detects the cases where the database has<br>
values such that  (value & mask) != value, and fixing the database to specify<br>
(value & mask) as value from now on. This would allow implementations to avoid<br>
having to mask the value at runtime, which would lead to a minor speedup (and<br>
to the spec being correct after all).<br>
Such code would be easy to write, as part of any of the existing<br>
implementations, I would think.</div></blockquote></div><br></div><div class="gmail_extra">Yes, I think that sounds reasonable, although of course implementations will need to support the existing data for some time, even if newer versions of shared-mime-info fix that. The downside is that update-mime-database is written in C, and as I found yesterday, I'm lousy at fixing C code. (Aside: this is an occasionally used script where performance isn't that important - would it make sense to write it in Python rather than C?)<br>

</div><div class="gmail_extra"><br></div><div class="gmail_extra">I've just inspected the values I have. There aren't many rules using masks at all. Of those that are, 5 need the mask applied, in all cases because they use a placeholder character where the mask has a null byte.<br>

<br></div><div class="gmail_extra">- application/x-core, application/x-sharedlib and application/vnd.adobe.photoshop use spaces<br></div><div class="gmail_extra">- image/bmp uses lowercase 'x'<br></div><div class="gmail_extra">

- application/vnd.corel-draw uses an uppercase 'X'<br><br></div><div class="gmail_extra">Thomas<br></div></div>