all: use built-in max/min to simplify the code

Change-Id: Ic195ff4df3749050079c85739f61897279933268
Reviewed-on: https://go-review.googlesource.com/c/text/+/664816
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
diff --git a/secure/precis/enforce_test.go b/secure/precis/enforce_test.go
index 0ced110..d86a42f 100644
--- a/secure/precis/enforce_test.go
+++ b/secure/precis/enforce_test.go
@@ -92,13 +92,6 @@
 	}
 }
 
-func min(a, b int) int {
-	if a < b {
-		return a
-	}
-	return b
-}
-
 // TestTransformerShortBuffers tests that the precis.Transformer implements the
 // spirit, not just the letter (the method signatures), of the
 // transform.Transformer interface.
diff --git a/unicode/bidi/core.go b/unicode/bidi/core.go
index 9d2ae54..fb82732 100644
--- a/unicode/bidi/core.go
+++ b/unicode/bidi/core.go
@@ -427,13 +427,6 @@
 
 func (i *isolatingRunSequence) Len() int { return len(i.indexes) }
 
-func maxLevel(a, b level) level {
-	if a > b {
-		return a
-	}
-	return b
-}
-
 // Rule X10, second bullet: Determine the start-of-sequence (sos) and end-of-sequence (eos) types,
 // either L or R, for each isolating run sequence.
 func (p *paragraph) isolatingRunSequence(indexes []int) *isolatingRunSequence {
@@ -474,8 +467,8 @@
 		indexes: indexes,
 		types:   types,
 		level:   level,
-		sos:     typeForLevel(maxLevel(prevLevel, level)),
-		eos:     typeForLevel(maxLevel(succLevel, level)),
+		sos:     typeForLevel(max(prevLevel, level)),
+		eos:     typeForLevel(max(succLevel, level)),
 	}
 }