aboutsummaryrefslogtreecommitdiffstats
path: root/common/util.h
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-23 16:12:52 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-23 16:12:52 +0200
commit1e8840b0f9400a1dc17ba6c7496314f82f0db2e1 (patch)
tree73e00ef273a99badcb10c08e28188ab4061d0f47 /common/util.h
parent727f99267caf3de2d3884f00ac61fad1175705fc (diff)
downloadnextpnr-1e8840b0f9400a1dc17ba6c7496314f82f0db2e1.tar.gz
nextpnr-1e8840b0f9400a1dc17ba6c7496314f82f0db2e1.tar.bz2
nextpnr-1e8840b0f9400a1dc17ba6c7496314f82f0db2e1.zip
Update from increased clangformat line length
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'common/util.h')
-rw-r--r--common/util.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/common/util.h b/common/util.h
index 4c60292b..5e938635 100644
--- a/common/util.h
+++ b/common/util.h
@@ -29,8 +29,7 @@ NEXTPNR_NAMESPACE_BEGIN
// Get a value from a map-style container, returning default if value is not
// found
template <typename Container, typename KeyType, typename ValueType>
-ValueType get_or_default(const Container &ct, const KeyType &key,
- ValueType def = ValueType())
+ValueType get_or_default(const Container &ct, const KeyType &key, ValueType def = ValueType())
{
auto found = ct.find(key);
if (found == ct.end())
@@ -41,8 +40,7 @@ ValueType get_or_default(const Container &ct, const KeyType &key,
// Get a value from a map-style container, converting to int, and returning
// default if value is not found
-template <typename Container, typename KeyType>
-int int_or_default(const Container &ct, const KeyType &key, int def = 0)
+template <typename Container, typename KeyType> int int_or_default(const Container &ct, const KeyType &key, int def = 0)
{
auto found = ct.find(key);
if (found == ct.end())
@@ -59,8 +57,7 @@ bool bool_or_default(const Container &ct, const KeyType &key, bool def = false)
};
// Wrap an unordered_map, and allow it to be iterated over sorted by key
-template <typename K, typename V>
-std::map<K, V> sorted(const std::unordered_map<K, V> &orig)
+template <typename K, typename V> std::map<K, V> sorted(const std::unordered_map<K, V> &orig)
{
return std::map<K, V>(orig.begin(), orig.end());
};