From 2e0bfbf16e7aad18e3c679a65749bd824bfb3a6d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 17 Feb 2020 12:33:42 -0600
Subject: [PATCH v1 07/19] comment typos

---
 contrib/pgcrypto/imath.c               | 4 ++--
 src/backend/access/transam/multixact.c | 2 +-
 src/backend/commands/tablecmds.c       | 2 +-
 src/backend/executor/execExpr.c        | 2 +-
 src/backend/postmaster/bgworker.c      | 2 +-
 src/include/lib/simplehash.h           | 4 ++--
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/contrib/pgcrypto/imath.c b/contrib/pgcrypto/imath.c
index da4cdede76..a05a4bf5fd 100644
--- a/contrib/pgcrypto/imath.c
+++ b/contrib/pgcrypto/imath.c
@@ -3232,7 +3232,7 @@ s_embar(mp_int a, mp_int b, mp_int m, mp_int mu, mp_int c)
 
    We diverge from Knuth's algorithm in that we do not perform the subtraction
    from the remainder until we have determined that we have the correct
-   quotient digit. This makes our algorithm less efficient that Knuth because
+   quotient digit. This makes our algorithm less efficient than Knuth because
    we might have to perform multiple multiplication and comparison steps before
    the subtraction. The advantage is that it is easy to implement and ensure
    correctness without worrying about underflow from the subtraction.
@@ -3355,7 +3355,7 @@ s_udiv_knuth(mp_int u, mp_int v)
 
 		/*
 		 * Check to see if qhat > b, and decrease qhat if so. Theorem B
-		 * guarantess that qhat is at most 2 larger than the actual value, so
+		 * guarantees that qhat is at most 2 larger than the actual value, so
 		 * it is possible that qhat is greater than the maximum value that
 		 * will fit in a digit
 		 */
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index 70d0e1c215..e2aa5c9ce4 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -2666,7 +2666,7 @@ SetOffsetVacuumLimit(bool is_startup)
  * We use this to determine whether the addition is "wrapping around" the
  * boundary point, hence the name.  The reason we don't want to use the regular
  * 2^31-modulo arithmetic here is that we want to be able to use the whole of
- * the 2^32-1 space here, allowing for more multixacts that would fit
+ * the 2^32-1 space here, allowing for more multixacts than would fit
  * otherwise.
  */
 static bool
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 6162fb018c..037d457c3d 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -16846,7 +16846,7 @@ ATExecDetachPartition(Relation rel, RangeVar *name)
 	list_free_deep(fks);
 
 	/*
-	 * Any sub-constrains that are in the referenced-side of a larger
+	 * Any sub-constraints that are in the referenced-side of a larger
 	 * constraint have to be removed.  This partition is no longer part of the
 	 * key space of the constraint.
 	 */
diff --git a/src/backend/executor/execExpr.c b/src/backend/executor/execExpr.c
index 1370ffec50..c6a77bd66f 100644
--- a/src/backend/executor/execExpr.c
+++ b/src/backend/executor/execExpr.c
@@ -2366,7 +2366,7 @@ get_last_attnums_walker(Node *node, LastAttnumInfo *info)
  * evaluation of the expression will have the same type of slot, with an
  * equivalent descriptor.
  *
- * Returns true if the the deforming step is required, false otherwise.
+ * Returns true if the deforming step is required, false otherwise.
  */
 static bool
 ExecComputeSlotInfo(ExprState *state, ExprEvalStep *op)
diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c
index 6c684b5e12..beb5e85434 100644
--- a/src/backend/postmaster/bgworker.c
+++ b/src/backend/postmaster/bgworker.c
@@ -1149,7 +1149,7 @@ WaitForBackgroundWorkerShutdown(BackgroundWorkerHandle *handle)
  * Instruct the postmaster to terminate a background worker.
  *
  * Note that it's safe to do this without regard to whether the worker is
- * still running, or even if the worker may already have existed and been
+ * still running, or even if the worker may already have exited and been
  * unregistered.
  */
 void
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 8cb03cda6c..88f4c9a53f 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -560,7 +560,7 @@ restart:
 		uint32		curoptimal;
 		SH_ELEMENT_TYPE *entry = &data[curelem];
 
-		/* any empty bucket can directly be used */
+		/* any empty bucket can be used directly */
 		if (entry->status == SH_STATUS_EMPTY)
 		{
 			tb->members++;
@@ -633,7 +633,7 @@ restart:
 			/* shift forward, starting at last occupied element */
 
 			/*
-			 * TODO: This could be optimized to be one memcpy in may cases,
+			 * TODO: This could be optimized to be one memcpy in many cases,
 			 * excepting wrapping around at the end of ->data. Hasn't shown up
 			 * in profiles so far though.
 			 */
-- 
2.17.0

