Use QHash<K,V> instead of QMap<K,V> when K is a pointer type
Changes various internal usages of QMap when the key is a pointer type.
Being ordered by the pointer value itself, it makes very little sense
to use QMap<K*, V> (esp. in cases where the key is actually allocated
on the heap).
The usages have been found with the following script:
#!/usr/bin/perl
use strict;
use warnings;
use Regexp::Common;
use File::Find;
use feature ':5.10';
my $container = qr/(?:QMap)/;
sub process {
return unless (-f and -r and /(\.c|\.cpp|\.h|\.txt)$/);
open my $fh, "<", $_ or die "Cannot open $_: $!";
while (my $line = <$fh>) {
chomp $line;
while ($line =~ /($container\s*$RE{balanced}{-parens=>"<>"})/g) {
my $tmp = $1;
$tmp =~ s/\s+//g;
say "$_:$.: $line" if $tmp =~ /^$container\s*<[^,]+\*,/;
}
}
close $fh;
}
find( { no_chdir => 1, wanted => \&process }, @ARGV );
Change-Id: Idd9819c3f4c48f98ef92831d5e8e5ac0fa42283c
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>