gparted/include
Mike Fleetwood 9c35d91453 Refactor get_filesystem_object()
The function was using std::map::count() [1] to test if the file system
entry existed in the map before looking up the value using
std::map::operator[] to avoid having operator[] inserting elements which
don't exist [2].

Rewrite using std::map::find() [3] so that map is only searched once,
and so that it is more obvious what is happening without having to know
the subtleties of std::map::count() and ::operator[].

[1] std::map::count()
    http://www.cplusplus.com/reference/map/map/count/

    "Searches the container for elements with a key equivalent to k and
    returns the number of matches.

    Because all elements in a map container are unique, the function can
    only return 1 (if the element is found) or zero (otherwise).
    "

[2] std::map::operator[]
    http://www.cplusplus.com/reference/map/map/operator[]/

    "If k does not match the key of any element in the container, the
    function inserts a new element with that key and returns a reference
    to its mapped value.  Notice that this always increases the
    container size by one, even if no mapped value is assigned to the
    element (the element is constructed using its default constructor).
    "

[3] std::map::find
    http://www.cplusplus.com/reference/map/map/find/

    "Searches the container for an element with a key equivalent to k
    and returns an iterator to it if found, otherwise it returns an
    iterator to map::end.
    "
2018-09-17 15:36:09 +00:00
..
BlockSpecial.h Pre-populate BlockSpecial cache while reading /proc/partitions (#767842) 2016-08-06 09:47:58 -06:00
CopyBlocks.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
DMRaid.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
Device.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
DialogFeatures.h Move struct FS and FS_Limits into FileSystem.h 2018-01-28 10:09:35 -07:00
DialogManageFlags.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
DialogPasswordEntry.h Clear previous LUKS unlock failure error before next attempt (#795617) 2018-06-19 10:54:48 -06:00
Dialog_Base_Partition.h Move struct FS and FS_Limits into FileSystem.h 2018-01-28 10:09:35 -07:00
Dialog_Disklabel.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
Dialog_FileSystem_Label.h Simplify from Gtk::Table to HBox in FileSystem Label dialog 2018-06-18 10:15:33 -06:00
Dialog_Partition_Copy.h Move struct FS and FS_Limits into FileSystem.h 2018-01-28 10:09:35 -07:00
Dialog_Partition_Info.h Provide virtual Partition::get_filesystem_partition() method (#774818) 2017-01-14 08:49:58 -07:00
Dialog_Partition_Name.h Simplify from Gtk::Table to HBox in Partition Name dialog 2018-06-18 10:15:33 -06:00
Dialog_Partition_New.h Rename enum FILESYSTEM to FSType 2018-01-28 10:09:35 -07:00
Dialog_Partition_Resize_Move.h Move struct FS and FS_Limits into FileSystem.h 2018-01-28 10:09:35 -07:00
Dialog_Progress.h Rename OperationDetailStatus STATUS_N_A to STATUS_WARNING 2017-11-26 10:53:52 -07:00
Dialog_Rescue_Data.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
DrawingAreaVisualDisk.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
FS_Info.h Make sure that FS_Info cache is loaded for all named paths (#787181) 2017-09-12 19:10:20 +01:00
FileSystem.h Separate unknown file system type from unsupported actions (!13) 2018-09-17 15:36:09 +00:00
Frame_Resizer_Base.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
Frame_Resizer_Extended.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
GParted_Core.h Refactor get_filesystem_object() 2018-09-17 15:36:09 +00:00
HBoxOperations.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
LUKS_Info.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
LVM2_PV_Info.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
Makefile.am Re-assign UFS to be a basic supported file system (!13) 2018-09-17 15:36:09 +00:00
Mount_Info.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
Operation.h Create and use general find_extended_partition() function 2017-01-14 08:49:58 -07:00
OperationChangeUUID.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OperationCheck.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OperationCopy.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OperationCreate.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OperationDelete.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OperationDetail.h Rename OperationDetailStatus STATUS_N_A to STATUS_WARNING 2017-11-26 10:53:52 -07:00
OperationFormat.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OperationLabelFileSystem.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OperationNamePartition.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OperationResizeMove.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
Partition.h Rename enum FILESYSTEM to FSType 2018-01-28 10:09:35 -07:00
PartitionLUKS.h Rename enum FILESYSTEM to FSType 2018-01-28 10:09:35 -07:00
PartitionVector.h Create and use general find_extended_partition() function 2017-01-14 08:49:58 -07:00
PasswordRAMStore.h Change to insert or replace PasswordRAMStore::store() interface (#795617) 2018-04-30 09:10:48 -06:00
PipeCapture.h Further improve speed of PipeCapture for non-watched output (#777973) 2017-06-02 11:47:35 -06:00
Proc_Partitions_Info.h Switch to a static interface for Proc_Partitions_Info 2016-08-06 09:47:58 -06:00
ProgressBar.h Write a generic progress bar class (#760709) 2016-02-12 09:09:56 -07:00
SWRaid_Info.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
TreeView_Detail.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
Utils.h Re-assign UFS to be a basic supported file system (!13) 2018-09-17 15:36:09 +00:00
Win_GParted.h Remove unused member Win_GParted::menu_item 2018-08-01 19:03:01 +01:00
btrfs.h Stop providing a default for FileSystem::resize() fill_partition argument 2016-12-12 13:15:34 -07:00
exfat.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
ext2.h Remove checks for e4fsprogs commands (#794253) 2018-03-26 10:16:45 -06:00
f2fs.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
fat16.h Rework scope of fat16:: and ntfs::Change_UUID_Warning vectors 2018-06-18 14:47:17 -06:00
hfs.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
hfsplus.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
i18n.h Make include guards unique (#539297) 2013-06-05 10:57:39 -06:00
jfs.h Stop providing a default for FileSystem::resize() fill_partition argument 2016-12-12 13:15:34 -07:00
linux_swap.h Make get_custom_text() and get_generic_text() return by reference 2018-06-18 10:15:33 -06:00
luks.h Make get_custom_text() and get_generic_text() return by reference 2018-06-18 10:15:33 -06:00
lvm2_pv.h Make get_custom_text() and get_generic_text() return by reference 2018-06-18 10:15:33 -06:00
minix.h Add support for minix file system (!12) 2018-08-24 20:22:08 +01:00
nilfs2.h Stop providing a default for FileSystem::resize() fill_partition argument 2016-12-12 13:15:34 -07:00
ntfs.h Rework scope of fat16:: and ntfs::Change_UUID_Warning vectors 2018-06-18 14:47:17 -06:00
reiser4.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
reiserfs.h Stop providing a default for FileSystem::resize() fill_partition argument 2016-12-12 13:15:34 -07:00
udf.h Set dynamic UDF file system size limits (#787204) 2018-01-28 10:09:35 -07:00
xfs.h Stop providing a default for FileSystem::resize() fill_partition argument 2016-12-12 13:15:34 -07:00