subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1615485 - in /subversion/branches/authzperf/subversion: libsvn_repos/authz_parse.c tests/libsvn_repos/authz.rules
Date Mon, 04 Aug 2014 03:51:49 GMT
Author: brane
Date: Mon Aug  4 03:51:49 2014
New Revision: 1615485

URL: http://svn.apache.org/r1615485
Log:
On the authzperf branch: Make the sorted ACEs actually useful for lookups.

* subversion/libsvn_repos/authz_parse.c
  (compare_aces): Sort ACEs lexicographically by name.
* subversion/tests/libsvn_repos/authz.rules:
   Modify ACE entry to check that sorting works.

Modified:
    subversion/branches/authzperf/subversion/libsvn_repos/authz_parse.c
    subversion/branches/authzperf/subversion/tests/libsvn_repos/authz.rules

Modified: subversion/branches/authzperf/subversion/libsvn_repos/authz_parse.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_repos/authz_parse.c?rev=1615485&r1=1615484&r2=1615485&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_repos/authz_parse.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_repos/authz_parse.c Mon Aug  4 03:51:49
2014
@@ -705,16 +705,18 @@ merge_alias_ace(void *baton,
 
 
 /* Comparison function for sorting an array of ACEs.
-   Sorts group rules first and inverted rules last. */
+   Groups ACEs by name, putting inverted entries last.
+   This lets us use a binary search for the user name. */
 static int
 compare_aces(const void *left, const void *right)
 {
   const authz_ace_t *const a = left;
   const authz_ace_t *const b = right;
 
-  if (!a->inverted != !b->inverted)
+  const int cmp = strcmp(a->name, b->name);
+  if (cmp == 0 && !a->inverted != !b->inverted)
     return (a->inverted ? 1 : -1);
-  return strcmp(a->name, b->name);
+  return cmp;
 }
 
 

Modified: subversion/branches/authzperf/subversion/tests/libsvn_repos/authz.rules
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/libsvn_repos/authz.rules?rev=1615485&r1=1615484&r2=1615485&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/libsvn_repos/authz.rules (original)
+++ subversion/branches/authzperf/subversion/tests/libsvn_repos/authz.rules Mon Aug  4 03:51:49
2014
@@ -11,9 +11,9 @@ luser = w
 @y = w
 
 [:glob:bloop:/]
+~luser =
 ~@x = w
 luser = rw
-~luser =
 
 [aliases]
 x = luser



Mime
View raw message