Commits

Anonymous committed 5f3a3a0

remove duplicate logic (call riak_util:compare_dates/2, instead of copying here)

Comments (0)

Files changed (1)

src/riak_object.erl

 
 compare_content_dates(C1,C2) ->
     % true if C1 was modifed later than C2
-    A1 = calendar:datetime_to_gregorian_seconds(
-	   httpd_util:convert_request_date(
-             dict:fetch(<<"X-Riak-Last-Modified">>, C1#r_content.metadata))),
-    B1 = calendar:datetime_to_gregorian_seconds(
-	   httpd_util:convert_request_date(
-             dict:fetch(<<"X-Riak-Last-Modified">>, C2#r_content.metadata))),
-    A1 > B1.
+    riak_util:compare_dates(
+      dict:fetch(<<"X-Riak-Last-Modified">>, C1#r_content.metadata),
+      dict:fetch(<<"X-Riak-Last-Modified">>, C2#r_content.metadata)).
 
 %% @spec merge(riak_object(), riak_object()) -> riak_object()
 %% @doc  Merge the contents and vclocks of OldObject and NewObject. 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.