mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Fix comparison function in qt-models/divelocationmodel.cpp
The function dive_site_less_than() in qt-models/divelocationmodel.cpp
does not what it promises: it uses less-or-equal instead of less-than
comparison.
Note that, even though this may sound pedantic, this is an actual bug.
Usually, sorting functions suppose that they are provided with
strict weak ordering, which <= does *not* provide.
This is the actual reason for the crash mentioned in commit
f8a3a85210.
While touching this function, make it of static linkage, since
its usage is local to this translation unit.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
			
			
This commit is contained in:
		
							parent
							
								
									d1545b27b4
								
							
						
					
					
						commit
						bf65f1e507
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -7,9 +7,9 @@ | |||
| #include <QIcon> | ||||
| #include <core/gettextfromc.h> | ||||
| 
 | ||||
| bool dive_site_less_than(dive_site *a, dive_site *b) | ||||
| static bool dive_site_less_than(dive_site *a, dive_site *b) | ||||
| { | ||||
| 	return QString(a->name) <= QString(b->name); | ||||
| 	return QString(a->name) < QString(b->name); | ||||
| } | ||||
| 
 | ||||
| LocationInformationModel *LocationInformationModel::instance() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue