summaryrefslogtreecommitdiff
path: root/storage/innobase/include/lock0priv.ic
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-08-13 12:34:12 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-08-16 05:53:50 +0300
commit658350657005569f11bd6f9c97753a6cf24427f7 (patch)
tree367aded850bab2f538aa1375da99577f804dea39 /storage/innobase/include/lock0priv.ic
parent3ce8a0fc494ef8d1561cde4bf3a467d465e0c70e (diff)
downloadmariadb-git-658350657005569f11bd6f9c97753a6cf24427f7.tar.gz
Rename lock_pool_t to lock_list
Also, replace reverse iteration with forward iteration. lock_table_has(): Remove a redundant condition.
Diffstat (limited to 'storage/innobase/include/lock0priv.ic')
-rw-r--r--storage/innobase/include/lock0priv.ic12
1 files changed, 3 insertions, 9 deletions
diff --git a/storage/innobase/include/lock0priv.ic b/storage/innobase/include/lock0priv.ic
index 150a80b7be4..b5be9076644 100644
--- a/storage/innobase/include/lock0priv.ic
+++ b/storage/innobase/include/lock0priv.ic
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -388,17 +389,10 @@ lock_table_has(
const dict_table_t* table, /*!< in: table */
lock_mode in_mode)/*!< in: lock mode */
{
- if (trx->lock.table_locks.empty()) {
- return(NULL);
- }
-
- typedef lock_pool_t::const_reverse_iterator iterator;
-
- iterator end = trx->lock.table_locks.rend();
-
/* Look for stronger locks the same trx already has on the table */
- for (iterator it = trx->lock.table_locks.rbegin(); it != end; ++it) {
+ for (lock_list::const_iterator it = trx->lock.table_locks.begin(),
+ end = trx->lock.table_locks.end(); it != end; ++it) {
const lock_t* lock = *it;