summaryrefslogtreecommitdiffstats
path: root/lib/private/naturalsort_defaultcollator.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/naturalsort_defaultcollator.php')
-rw-r--r--lib/private/naturalsort_defaultcollator.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/private/naturalsort_defaultcollator.php b/lib/private/naturalsort_defaultcollator.php
new file mode 100644
index 00000000000..e1007f8d7b4
--- /dev/null
+++ b/lib/private/naturalsort_defaultcollator.php
@@ -0,0 +1,19 @@
+<?php
+/**
+ * Copyright (c) 2014 Vincent Petry <PVince81@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ *
+ */
+
+namespace OC;
+
+class NaturalSort_DefaultCollator {
+ public function compare($a, $b) {
+ if ($a === $b) {
+ return 0;
+ }
+ return ($a < $b) ? -1 : 1;
+ }
+}